Box2DX.Dynamics.DebugDraw.DrawSolidCircle C# (CSharp) Method

DrawSolidCircle() public abstract method

Draw a solid circle.
public abstract DrawSolidCircle ( Vec2 center, float radius, Vec2 axis, Color color ) : void
center Box2DX.Common.Vec2
radius float
axis Box2DX.Common.Vec2
color Color
return void
        public abstract void DrawSolidCircle(Vec2 center, float radius, Vec2 axis, Color color);

Usage Example

Example #1
0
        private void DrawShape(Fixture fixture, Transform xf, Color color)
        {
            Color coreColor = new Color(0.9f, 0.6f, 0.6f);

            switch (fixture.GetType())
            {
            case ShapeType.CircleShape:
            {
                CircleShape circle = (CircleShape)fixture.GetShape();

                Vec2  center = Math.Mul(xf, circle._p);
                float radius = circle._radius;
                Vec2  axis   = xf.R.Col1;

                _debugDraw.DrawSolidCircle(center, radius, axis, color);
            }
            break;

            case ShapeType.PolygonShape:
            {
                PolygonShape poly        = (PolygonShape)fixture.GetShape();
                int          vertexCount = poly.VertexCount;
                Box2DXDebug.Assert(vertexCount <= Settings.MaxPolygonVertices);
                Vec2[] vertices = new Vec2[Settings.MaxPolygonVertices];

                for (int i = 0; i < vertexCount; ++i)
                {
                    vertices[i] = Math.Mul(xf, poly.Vertices[i]);
                }

                _debugDraw.DrawSolidPolygon(vertices, vertexCount, color);
            }
            break;
            }
        }