Exemplo n.º 1
0
        private void DrawDebugConstraints()
        {
            pointConstraint.AddToDebugDrawList(lineList, pointList);

            basicEffect.Begin();
            basicEffect.View         = viewMatrix;
            basicEffect.Projection   = projectionMatrix;
            basicEffect.DiffuseColor = Color.Blue.ToVector3();

            foreach (EffectPass pass in basicEffect.CurrentTechnique.Passes)
            {
                pass.Begin();
                GraphicsDevice.RenderState.PointSize = 5;
                GraphicsDevice.VertexDeclaration     = new VertexDeclaration(GraphicsDevice, VertexPositionColor.VertexElements);

                if (pointList.Count > 0)
                {
                    GraphicsDevice.DrawUserPrimitives <JVector>(PrimitiveType.PointList, pointList.ToArray(), 0, pointList.Count);
                }
                if (lineList.Count > 0)
                {
                    GraphicsDevice.DrawUserPrimitives <JVector>(PrimitiveType.LineList, lineList.ToArray(), 0, lineList.Count / 2);
                }

                pass.End();
            }
            basicEffect.End();

            lineList.Clear();
            pointList.Clear();
        }