FarseerPhysics.Dynamics.Joints.FixedDistanceJoint.FixedDistanceJoint C# (CSharp) Method

FixedDistanceJoint() public method

This requires defining an anchor point on both bodies and the non-zero length of the distance joint. If you don't supply a length, the local anchor points is used so that the initial configuration can violate the constraint slightly. This helps when saving and loading a game. @warning Do not use a zero or short length.
public FixedDistanceJoint ( Body body, Vector2 bodyAnchor, Vector2 worldAnchor ) : System
body Body The body.
bodyAnchor Vector2 The body anchor.
worldAnchor Vector2 The world anchor.
return System
        public FixedDistanceJoint(Body body, Vector2 bodyAnchor, Vector2 worldAnchor)
            : base(body)
        {
            JointType = JointType.FixedDistance;

            LocalAnchorA = bodyAnchor;
            LocalAnchorB = worldAnchor;

            // Calculate the length
            Vector2 d = WorldAnchorB - WorldAnchorA;
            Length = d.Length();
        }