Table of Contents

Class RevoluteJoint

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

A revolute joint constrains to bodies to share a common point while they are free to rotate about the point. The relative rotation about the shared point is the joint angle. You can limit the relative rotation with a joint limit that specifies a lower and upper angle. You can use a motor to drive the relative rotation about the shared point. A maximum motor torque is provided so that infinite forces are not generated.

public class RevoluteJoint : Joint

Inheritance

Inherited Members

Constructors

RevoluteJoint()

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

internal RevoluteJoint()

RevoluteJoint(Body, Body, Vector2, Vector2, bool)

Constructor of RevoluteJoint.

public RevoluteJoint(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 first body anchor.

anchorB Vector2

The second anchor.

useWorldCoordinates bool

Set to true if you are using world coordinates as anchors.

RevoluteJoint(Body, Body, Vector2, bool)

Constructor of RevoluteJoint.

public RevoluteJoint(Body bodyA, Body bodyB, Vector2 anchor, bool useWorldCoordinates = false)

Parameters

bodyA Body

The first body.

bodyB Body

The second body.

anchor Vector2

The shared anchor.

useWorldCoordinates bool

Fields

_enableLimit

The enable limit

private bool _enableLimit

Field Value

bool

_enableMotor

The enable motor

private bool _enableMotor

Field Value

bool

_impulse

The impulse

private Vector3 _impulse

Field Value

Vector3

_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

_limitState

The limit state

private LimitState _limitState

Field Value

LimitState

_localCenterA

The local center

private Vector2 _localCenterA

Field Value

Vector2

_localCenterB

The local center

private Vector2 _localCenterB

Field Value

Vector2

_lowerAngle

The lower angle

private float _lowerAngle

Field Value

float

_mass

The mass

private Mat33 _mass

Field Value

Mat33

_maxMotorTorque

The max motor torque

private float _maxMotorTorque

Field Value

float

_motorImpulse

The motor impulse

private float _motorImpulse

Field Value

float

_motorMass

The motor mass

private float _motorMass

Field Value

float

_motorSpeed

The motor speed

private float _motorSpeed

Field Value

float

_rA

The

private Vector2 _rA

Field Value

Vector2

_rB

The

private Vector2 _rB

Field Value

Vector2

_referenceAngle

The reference angle

private float _referenceAngle

Field Value

float

_upperAngle

The upper angle

private float _upperAngle

Field Value

float

invIa

The inv ia

private float invIa

Field Value

float

invIb

The inv ib

private float invIb

Field Value

float

Properties

JointAngle

Get the current joint angle in radians.

public float JointAngle { get; }

Property Value

float

JointSpeed

Get the current joint angle speed in radians per second.

public float JointSpeed { get; }

Property Value

float

LimitEnabled

Is the joint limit enabled?

public bool LimitEnabled { get; set; }

Property Value

bool

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

LowerLimit

Get the lower joint limit in radians.

public float LowerLimit { get; set; }

Property Value

float

MaxMotorTorque

Get or set the maximum motor torque, usually in N-m.

public float MaxMotorTorque { get; set; }

Property Value

float

MotorEnabled

Is the joint motor enabled?

public bool MotorEnabled { get; set; }

Property Value

bool

MotorImpulse

Get or set the current motor impulse, usually in N-m.

public float MotorImpulse { get; set; }

Property Value

float

MotorSpeed

Get or set the motor speed in radians per second.

public float MotorSpeed { get; set; }

Property Value

float

ReferenceAngle

The referance angle computed as BodyB angle minus BodyA angle.

public float ReferenceAngle { get; set; }

Property Value

float

UpperLimit

Get the upper joint limit in radians.

public float UpperLimit { get; set; }

Property Value

float

WorldAnchorA

Gets or sets the value of the world anchor a

public override Vector2 WorldAnchorA { get; set; }

Property Value

Vector2

WorldAnchorB

Gets or sets the value of the world anchor b

public override Vector2 WorldAnchorB { get; set; }

Property Value

Vector2

Methods

GetMotorTorque(float)

Gets the motor torque in N-m.

public float GetMotorTorque(float invDt)

Parameters

invDt float

The inverse delta time

Returns

float

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

SetLimits(float, float)

Set the joint limits, usually in meters.

public void SetLimits(float lower, float upper)

Parameters

lower float

The lower limit

upper float

The upper limit

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