C# Class Project290.Physics.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 = ant Yes, the force transmitted is scaled by the ratio. The pulley also enforces a maximum length limit on both sides. This is useful to prevent one side of the pulley hitting the top.
Inheritance: Joint
Show file Open project: scastle/Solitude Class Usage Examples

Public Properties

Property Type Description
GroundAnchorA Vector2
GroundAnchorB Vector2
LocalAnchorA Vector2
LocalAnchorB Vector2
MinPulleyLength float

Public Methods

Method Description
GetReactionForce ( float inv_dt ) : Vector2
GetReactionTorque ( float inv_dt ) : float
PulleyJoint ( Body bodyA, Body bodyB, Vector2 groundAnchorA, Vector2 groundAnchorB, Vector2 localAnchorA, Vector2 localAnchorB, float ratio ) : System

Initialize the bodies, anchors, lengths, max lengths, and ratio using the world anchors. This requires two ground anchors, two dynamic body anchor points, max lengths for each side, and a pulley ratio.

Private Methods

Method Description
InitVelocityConstraints ( TimeStep &step ) : void
SolvePositionConstraints ( ) : bool
SolveVelocityConstraints ( TimeStep &step ) : void

Method Details

GetReactionForce() public method

public GetReactionForce ( float inv_dt ) : Vector2
inv_dt float
return Vector2

GetReactionTorque() public method

public GetReactionTorque ( float inv_dt ) : float
inv_dt float
return float

PulleyJoint() public method

Initialize the bodies, anchors, lengths, max lengths, and ratio using the world anchors. This requires two ground anchors, two dynamic body anchor points, max lengths for each side, and a pulley ratio.
public PulleyJoint ( Body bodyA, Body bodyB, Vector2 groundAnchorA, Vector2 groundAnchorB, Vector2 localAnchorA, Vector2 localAnchorB, float ratio ) : System
bodyA Body The first body.
bodyB Body The second body.
groundAnchorA Vector2 The ground anchor for the first body.
groundAnchorB Vector2 The ground anchor for the second body.
localAnchorA Vector2 The first body anchor.
localAnchorB Vector2 The second body anchor.
ratio float The ratio.
return System

Property Details

GroundAnchorA public property

Get the first ground anchor.
public Vector2 GroundAnchorA
return Vector2

GroundAnchorB public property

Get the second ground anchor.
public Vector2 GroundAnchorB
return Vector2

LocalAnchorA public property

public Vector2 LocalAnchorA
return Vector2

LocalAnchorB public property

public Vector2 LocalAnchorB
return Vector2

MinPulleyLength public property

public float MinPulleyLength
return float