Table of Contents

Class RopeJoint

Namespace
Alis.Core.Physic.Dynamics.Joints
Assembly
Alis.dll

A rope joint enforces a maximum distance between two points on two bodies. It has no other effect. It can be used on ropes that are made up of several connected bodies, and if there is a need to support a heavy body. This joint is used for stabiliation of heavy objects on soft constraint joints. Warning: if you attempt to change the maximum length during the simulation you will get some non-physical behavior. Use the DistanceJoint instead if you want to dynamically control the length.

public class RopeJoint : Joint

Inheritance

Inherited Members

Remarks

Limit: C = norm(pB - pA) - L u = (pB - pA) / norm(pB - pA) Cdot = dot(u, vB + cross(wB, rB) - vA - cross(wA, rA)) J = [-u -cross(rA, u) u cross(rB, u)] K = J * invM * JT = invMassA + invIA * cross(rA, u)^2 + invMassB + invIB * cross(rB, u)^2

Constructors

RopeJoint()

Initializes a new instance of the Alis.Core.Physic.Dynamics.Joints.RopeJoint class

internal RopeJoint()

RopeJoint(Body, Body, Vector2, Vector2, bool)

Constructor for RopeJoint.

public RopeJoint(Body bodyA, Body bodyB, Vector2 anchorA, Vector2 anchorB, 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

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

_length

The length

private float _length

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

_u

The

private Vector2 _u

Field Value

Vector2

invIa

The inv ia

private float invIa

Field Value

float

invIb

The inv ib

private float invIb

Field Value

float

Properties

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

MaxLength

Get or set the maximum length of the rope. By default, it is the distance between the two anchor points.

public float MaxLength { get; set; }

Property Value

float

State

Gets the state of the joint.

public LimitState State { get; private set; }

Property Value

LimitState

WorldAnchorA

Gets or sets the value of the world anchor a

public override sealed Vector2 WorldAnchorA { get; set; }

Property Value

Vector2

WorldAnchorB

Gets or sets the value of the world anchor b

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