Table of Contents

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 : Joint

Inheritance

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

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.

Fields

_impulse

The impulse

private float _impulse

Field Value

float

_indexA

The index

private int _indexA

Field Value

int

_indexB

The index

private int _indexB

Field Value

int

_invMassA

The inv mass

private float _invMassA

Field Value

float

_invMassB

The inv mass

private float _invMassB

Field Value

float

_localCenterA

The local center

private Vector2 _localCenterA

Field Value

Vector2

_localCenterB

The local center

private Vector2 _localCenterB

Field Value

Vector2

_mass

The mass

private float _mass

Field Value

float

_rA

The

private Vector2 _rA

Field Value

Vector2

_rB

The

private Vector2 _rB

Field Value

Vector2

_uA

The

private Vector2 _uA

Field Value

Vector2

_uB

The

private Vector2 _uB

Field Value

Vector2

invIa

The inv ia

private float invIa

Field Value

float

invIb

The inv ib

private float invIb

Field Value

float

Properties

Constant

Gets or sets the value of the constant

internal float Constant { get; set; }

Property Value

float

CurrentLengthA

The current length between the anchor point on BodyA and WorldAnchorA

public float CurrentLengthA { get; }

Property Value

float

CurrentLengthB

The current length between the anchor point on BodyB and WorldAnchorB

public float CurrentLengthB { get; }

Property Value

float

LengthA

Get the current length of the segment attached to body1.

public float LengthA { get; set; }

Property Value

float

LengthB

Get the current length of the segment attached to body2.

public float LengthB { get; set; }

Property Value

float

LocalAnchorA

The local anchor point on BodyA

public Vector2 LocalAnchorA { get; set; }

Property Value

Vector2

LocalAnchorB

The local anchor point on BodyB

public Vector2 LocalAnchorB { get; set; }

Property Value

Vector2

Ratio

Get the pulley ratio.

public float Ratio { get; set; }

Property Value

float

WorldAnchorA

Get the first world anchor.

public override sealed Vector2 WorldAnchorA { get; set; }

Property Value

Vector2

WorldAnchorB

Get the second world anchor.

public override sealed Vector2 WorldAnchorB { get; set; }

Property Value

Vector2

Methods

GetReactionForce(float)

Gets the reaction force using the specified inv dt

public override Vector2 GetReactionForce(float invDt)

Parameters

invDt float

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

invDt float

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

data SolverData

The data

SolvePositionConstraints(ref SolverData)

Describes whether this instance solve position constraints

internal override bool SolvePositionConstraints(ref SolverData data)

Parameters

data SolverData

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

data SolverData

The data