示例#1
0
    public void DebugDraw()
    {
        if (mSpace == null)
        {
            return;
        }

        if ((Flags & cpDrawFlags.All) == cpDrawFlags.All || (Flags & cpDrawFlags.BB) == cpDrawFlags.BB || (Flags & cpDrawFlags.Shapes) == cpDrawFlags.Shapes)
        {
            mSpace.EachShape(DrawShape);
        }

        if ((Flags & cpDrawFlags.Joints) == cpDrawFlags.Joints || (Flags & cpDrawFlags.All) == cpDrawFlags.All)
        {
            mSpace.EachConstraint(DrawConstraint);
        }

        if ((Flags & cpDrawFlags.All) == cpDrawFlags.All || (Flags & cpDrawFlags.ContactPoints) == cpDrawFlags.ContactPoints)
        {
            for (var i = 0; i < mSpace.arbiters.Count; i++)
            {
                for (int j = 0; j < mSpace.arbiters[i].contacts.Count; j++)
                {
                    Draw(mSpace.arbiters[i].contacts[i]);
                }
            }
        }
    }