Example #1
0
        protected override void Draw(GameTime gameTime)
        {
            GraphicsDevice.Clear(Color.CornflowerBlue);

            RasterizerState rasterizerState = new RasterizerState();

            rasterizerState.CullMode       = CullMode.None;
            GraphicsDevice.RasterizerState = rasterizerState;

            //DrawModel(road, camera.ProjectionMatrix,camera.ViewMatrix,character.GetWorldMatrix() * Matrix.CreateTranslation(new Vector3(-.5f,-0.35f,0)));

            character.Draw(camera);
            DrawRoads();

            if (box != null)
            {
                Drawer.DrawModel(box.Model, camera, box.WorldMatrix, 0.05f);
            }

            //DrawFloor();

            //Draw BB's
            Drawer.DrawBoundingBox(BoundingBoxBuffers.CreateBoundingBoxBuffers(character.BoundingBox, GraphicsDevice), lineEffect, GraphicsDevice, camera.ViewMatrix, camera.ProjectionMatrix);
            Drawer.DrawBoundingBox(BoundingBoxBuffers.CreateBoundingBoxBuffers(box.BoundingBox, GraphicsDevice), lineEffect1, GraphicsDevice, camera.ViewMatrix, camera.ProjectionMatrix);
            base.Draw(gameTime);
        }