Beispiel #1
0
        /// <summary>
        /// Draws a bounding box anywhere you specify, Is used to test fixed cordinates
        /// </summary>
        public void DrawTestBoundingBox(BoundingBox a_box, GraphicsDevice graphicsDevice, Camera a_camera)
        {
            BoundingBoxBuffer.CreateBoundingBoxBuffers(a_box);

            graphicsDevice.SetVertexBuffer(BoundingBoxBuffer.m_vertexBuffer);
            graphicsDevice.Indices = BoundingBoxBuffer.m_indexBuffer;

            a_camera.m_BoundingBoxEffect.World = Matrix.Identity;
            a_camera.m_BoundingBoxEffect.View  = a_camera.m_view;

            foreach (EffectPass pass in a_camera.m_BoundingBoxEffect.CurrentTechnique.Passes)
            {
                pass.Apply();
                graphicsDevice.DrawIndexedPrimitives(PrimitiveType.LineList, 0, 0,
                                                     BoundingBoxBuffer.VertexCount, 0, BoundingBoxBuffer.PrimitiveCount);
            }

            graphicsDevice.SetVertexBuffer(null);
        }
Beispiel #2
0
        /// <summary>
        /// Draws a bounding box with longer lines than the DrawBoundingBox(), useful for eg building tiles
        /// </summary>
        public static void DrawBoundingBoxBiggerLines(BoundingBox a_box, GraphicsDevice graphicsDevice, Matrix a_world, Camera a_camera)
        {
            BoundingBoxBuffer.CreateBoundingBoxBuffersBiggerLines(a_box);

            DrawBoundingBoxFunction(graphicsDevice, a_world, a_camera);
        }