Box2DX.Dynamics.World.GetGroundBody C# (CSharp) Method

GetGroundBody() public method

The world provides a single static ground body with no collision shapes. You can use this to simplify the creation of joints and static shapes.
public GetGroundBody ( ) : Body
return Body
        public Body GetGroundBody()
        {
            return _groundBody;
        }

Usage Example

 /** Handles anchoring the first and last pieces of the bridge
  * to the world versus to other bridge pieces
  */
 private void CreateEndJoint(World world, bool leftEnd)
 {
     RevoluteJointDef joint = new RevoluteJointDef();
     Vector2 anchor = Position - new Vector2(width/2, 0);
     if (!leftEnd)
         anchor = Position + new Vector2(width / 2, 0);
     joint.Initialize(Body, world.GetGroundBody(), Utils.Convert(anchor));
     world.CreateJoint(joint);
 }