C# Class FarseerPhysics.Dynamics.Joints.PulleyJoint

The pulley joint is connected to two bodies and two fixed ground points. The pulley supports a ratio such that: length1 + ratio * length2 <= constant Yes, the force transmitted is scaled by the ratio. Warning: the pulley joint can get a bit squirrelly by itself. They often work better when combined with prismatic joints. You should also cover the the anchor points with static shapes to prevent one side from going to zero length.
Inheritance: Joint
Show file Open project: prime31/Nez Class Usage Examples

Public Properties

Property Type Description
lengthA float
lengthB float
localAnchorA Vector2
localAnchorB Vector2
ratio float

Public Methods

Method Description
PulleyJoint ( Body bodyA, Body bodyB, Vector2 anchorA, Vector2 anchorB, Vector2 worldAnchorA, Vector2 worldAnchorB, float ratio, bool useWorldCoordinates = false ) : System

Constructor for PulleyJoint.

getReactionForce ( float invDt ) : Vector2
getReactionTorque ( float invDt ) : float

Private Methods

Method Description
PulleyJoint ( ) : System
initVelocityConstraints ( SolverData &data ) : void
solvePositionConstraints ( SolverData &data ) : bool
solveVelocityConstraints ( SolverData &data ) : void

Method Details

PulleyJoint() public method

Constructor for PulleyJoint.
public PulleyJoint ( Body bodyA, Body bodyB, Vector2 anchorA, Vector2 anchorB, Vector2 worldAnchorA, Vector2 worldAnchorB, float ratio, bool useWorldCoordinates = false ) : System
bodyA Body The first body.
bodyB Body The second body.
anchorA Vector2 The anchor on the first body.
anchorB Vector2 The anchor on the second body.
worldAnchorA Vector2 The world anchor for the first body.
worldAnchorB Vector2 The world anchor for the second body.
ratio float The ratio.
useWorldCoordinates bool Set to true if you are using world coordinates as anchors.
return System

getReactionForce() public method

public getReactionForce ( float invDt ) : Vector2
invDt float
return Vector2

getReactionTorque() public method

public getReactionTorque ( float invDt ) : float
invDt float
return float

Property Details

lengthA public property

Get the current length of the segment attached to body1.
public float lengthA
return float

lengthB public property

Get the current length of the segment attached to body2.
public float lengthB
return float

localAnchorA public property

The local anchor point on BodyA
public Vector2 localAnchorA
return Vector2

localAnchorB public property

The local anchor point on BodyB
public Vector2 localAnchorB
return Vector2

ratio public property

Get the pulley ratio.
public float ratio
return float