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
_enableMotor
The enable motor
private bool _enableMotor
Field Value
_impulse
The impulse
private Vector3 _impulse
Field Value
_indexA
The index
private int _indexA
Field Value
_indexB
The index
private int _indexB
Field Value
_invMassA
The inv mass
private float _invMassA
Field Value
_invMassB
The inv mass
private float _invMassB
Field Value
_limitState
The limit state
private LimitState _limitState
Field Value
_localCenterA
The local center
private Vector2 _localCenterA
Field Value
_localCenterB
The local center
private Vector2 _localCenterB
Field Value
_lowerAngle
The lower angle
private float _lowerAngle
Field Value
_mass
The mass
private Mat33 _mass
Field Value
_maxMotorTorque
The max motor torque
private float _maxMotorTorque
Field Value
_motorImpulse
The motor impulse
private float _motorImpulse
Field Value
_motorMass
The motor mass
private float _motorMass
Field Value
_motorSpeed
The motor speed
private float _motorSpeed
Field Value
_rA
The
private Vector2 _rA
Field Value
_rB
The
private Vector2 _rB
Field Value
_referenceAngle
The reference angle
private float _referenceAngle
Field Value
_upperAngle
The upper angle
private float _upperAngle
Field Value
invIa
The inv ia
private float invIa
Field Value
invIb
The inv ib
private float invIb
Field Value
Properties
JointAngle
Get the current joint angle in radians.
public float JointAngle { get; }
Property Value
JointSpeed
Get the current joint angle speed in radians per second.
public float JointSpeed { get; }
Property Value
LimitEnabled
Is the joint limit enabled?
public bool LimitEnabled { 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
LowerLimit
Get the lower joint limit in radians.
public float LowerLimit { get; set; }
Property Value
MaxMotorTorque
Get or set the maximum motor torque, usually in N-m.
public float MaxMotorTorque { get; set; }
Property Value
MotorEnabled
Is the joint motor enabled?
public bool MotorEnabled { get; set; }
Property Value
MotorImpulse
Get or set the current motor impulse, usually in N-m.
public float MotorImpulse { get; set; }
Property Value
MotorSpeed
Get or set the motor speed in radians per second.
public float MotorSpeed { get; set; }
Property Value
ReferenceAngle
The referance angle computed as BodyB angle minus BodyA angle.
public float ReferenceAngle { get; set; }
Property Value
UpperLimit
Get the upper joint limit in radians.
public float UpperLimit { get; set; }
Property Value
WorldAnchorA
Gets or sets the value of the world anchor a
public override Vector2 WorldAnchorA { get; set; }
Property Value
WorldAnchorB
Gets or sets the value of the world anchor b
public override Vector2 WorldAnchorB { get; set; }
Property Value
Methods
GetMotorTorque(float)
Gets the motor torque in N-m.
public float GetMotorTorque(float invDt)
Parameters
invDt
float-
The inverse delta time
Returns
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
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