Esempio n. 1
0
 /// <summary>
 ///     Adds a distance joint. A distance joint constrains two points on two bodies to remain at a fixed distance from each
 ///     other. You can view this as a massless, rigid rod.
 ///     <para/>
 ///     This overload attaches a body to a fixed point in the world.
 /// </summary>
 /// <param name="manager">The manager.</param>
 /// <param name="body">The body.</param>
 /// <param name="anchorWorld">The anchor in the world, in world coordinates.</param>
 /// <param name="anchorBody">The anchor on the body, in world coordinates.</param>
 /// <param name="frequency">The mass-spring-damper frequency in Hertz. A value of 0 disables softness.</param>
 /// <param name="dampingRatio">The damping ratio. 0 = no damping, 1 = critical damping.</param>
 /// <param name="collideConnected">Whether the two bodies still collide.</param>
 /// <returns>The created joint.</returns>
 /// <remarks>Do not use a zero or short length.</remarks>
 public static DistanceJoint AddDistanceJoint(
     this IManager manager,
     Body body,
     WorldPoint anchorWorld,
     WorldPoint anchorBody,
     float frequency       = 0,
     float dampingRatio    = 0,
     bool collideConnected = false)
 {
     return(manager.AddDistanceJoint(
                body, manager.GetSimulation().FixPoint, anchorWorld, anchorBody, frequency, dampingRatio, collideConnected));
 }