Class PulleyJoint
- Namespace
- Alis.Core.Physic.Dynamics.Joints
- Assembly
- Alis.dll
The pulley joint is connected to two bodies and two fixed world 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.
public class PulleyJoint : JointInheritance
Inherited Members
Constructors
PulleyJoint()
Initializes a new instance of the Alis.Core.Physic.Dynamics.Joints.PulleyJoint class
internal PulleyJoint()PulleyJoint(Body, Body, Vector2, Vector2, Vector2, Vector2, float, bool)
Constructor for PulleyJoint.
public PulleyJoint(Body bodyA, Body bodyB, Vector2 anchorA, Vector2 anchorB, Vector2 worldAnchorA, Vector2 worldAnchorB, float ratio, bool useWorldCoordinates = false)Parameters
bodyABody-
The first body.
bodyBBody-
The second body.
anchorAVector2-
The anchor on the first body.
anchorBVector2-
The anchor on the second body.
worldAnchorAVector2-
The world anchor for the first body.
worldAnchorBVector2-
The world anchor for the second body.
ratiofloat-
The ratio.
useWorldCoordinatesbool-
Set to true if you are using world coordinates as anchors.
Fields
_impulse
The impulse
private float _impulseField Value
_indexA
The index
private int _indexAField Value
_indexB
The index
private int _indexBField Value
_invMassA
The inv mass
private float _invMassAField Value
_invMassB
The inv mass
private float _invMassBField Value
_localCenterA
The local center
private Vector2 _localCenterAField Value
_localCenterB
The local center
private Vector2 _localCenterBField Value
_mass
The mass
private float _massField Value
_rA
The
private Vector2 _rAField Value
_rB
The
private Vector2 _rBField Value
_uA
The
private Vector2 _uAField Value
_uB
The
private Vector2 _uBField Value
invIa
The inv ia
private float invIaField Value
invIb
The inv ib
private float invIbField Value
Properties
Constant
Gets or sets the value of the constant
internal float Constant { get; set; }Property Value
CurrentLengthA
The current length between the anchor point on BodyA and WorldAnchorA
public float CurrentLengthA { get; }Property Value
CurrentLengthB
The current length between the anchor point on BodyB and WorldAnchorB
public float CurrentLengthB { get; }Property Value
LengthA
Get the current length of the segment attached to body1.
public float LengthA { get; set; }Property Value
LengthB
Get the current length of the segment attached to body2.
public float LengthB { get; set; }Property Value
LocalAnchorA
The local anchor point on BodyA
public Vector2 LocalAnchorA { get; set; }Property Value
LocalAnchorB
The local anchor point on BodyB
public Vector2 LocalAnchorB { get; set; }Property Value
Ratio
Get the pulley ratio.
public float Ratio { get; set; }Property Value
WorldAnchorA
Get the first world anchor.
public override sealed Vector2 WorldAnchorA { get; set; }Property Value
WorldAnchorB
Get the second world anchor.
public override sealed Vector2 WorldAnchorB { get; set; }Property Value
Methods
GetReactionForce(float)
Gets the reaction force using the specified inv dt
public override Vector2 GetReactionForce(float invDt)Parameters
invDtfloat-
The inv dt
Returns
- Vector2
-
The vector
GetReactionTorque(float)
Gets the reaction torque using the specified inv dt
public override float GetReactionTorque(float invDt)Parameters
invDtfloat-
The inv dt
Returns
- float
-
The float
InitVelocityConstraints(ref SolverData)
Inits the velocity constraints using the specified data
internal override void InitVelocityConstraints(ref SolverData data)Parameters
dataSolverData-
The data
SolvePositionConstraints(ref SolverData)
Describes whether this instance solve position constraints
internal override bool SolvePositionConstraints(ref SolverData data)Parameters
dataSolverData-
The data
Returns
- bool
-
The bool
SolveVelocityConstraints(ref SolverData)
Solves the velocity constraints using the specified data
internal override void SolveVelocityConstraints(ref SolverData data)Parameters
dataSolverData-
The data