Class GearJoint
- Namespace
- Alis.Core.Physic.Dynamics.Joints
- Assembly
- Alis.dll
A gear joint is used to connect two joints together. Either joint can be a revolute or prismatic joint. You specify a gear ratio to bind the motions together: coordinate1 + ratio * coordinate2 = ant The ratio can be negative or positive. If one joint is a revolute joint and the other joint is a prismatic joint, then the ratio will have units of length or units of 1/length. Warning: You have to manually destroy the gear joint if jointA or jointB is destroyed.
public class GearJoint : JointInheritance
Inherited Members
Constructors
GearJoint(Body, Body, Joint, Joint, float)
Requires two existing revolute or prismatic joints (any combination will work). The provided joints must attach a dynamic body to a static body.
public GearJoint(Body bodyA, Body bodyB, Joint jointA, Joint jointB, float ratio = 1)Parameters
bodyABody-
The first body
bodyBBody-
The second body
jointAJoint-
The first joint.
jointBJoint-
The second joint.
ratiofloat-
The ratio.
Fields
_JvAC
The jv bd
private Vector2 _JvACField Value
_JvBD
The jv bd
private Vector2 _JvBDField Value
_JwA
The jw
private float _JwAField Value
_JwB
The jw
private float _JwBField Value
_JwC
The jw
private float _JwCField Value
_JwD
The jw
private float _JwDField Value
_bodyA
The body
private readonly Body _bodyAField Value
_bodyB
The body
private readonly Body _bodyBField Value
_bodyC
The body
private readonly Body _bodyCField Value
_bodyD
The body
private readonly Body _bodyDField Value
_constant
The constant
private readonly float _constantField Value
_iA
The
private float _iAField Value
_iB
The
private float _iBField Value
_iC
The
private float _iCField Value
_iD
The
private float _iDField Value
_impulse
The impulse
private float _impulseField Value
_indexA
The index
private int _indexAField Value
_indexB
The index
private int _indexBField Value
_indexC
The index
private int _indexCField Value
_indexD
The index
private int _indexDField Value
_lcA
The lc
private Vector2 _lcAField Value
_lcB
The lc
private Vector2 _lcBField Value
_lcC
The lc
private Vector2 _lcCField Value
_lcD
The lc
private Vector2 _lcDField Value
_localAnchorA
The local anchor
private readonly Vector2 _localAnchorAField Value
_localAnchorB
The local anchor
private readonly Vector2 _localAnchorBField Value
_localAnchorC
The local anchor
private readonly Vector2 _localAnchorCField Value
_localAnchorD
The local anchor
private readonly Vector2 _localAnchorDField Value
_localAxisC
The local axis
private Vector2 _localAxisCField Value
_localAxisD
The local axis
private Vector2 _localAxisDField Value
_mA
The
private float _mAField Value
_mB
The
private float _mBField Value
_mC
The
private float _mCField Value
_mD
The
private float _mDField Value
_mass
The mass
private float _massField Value
_ratio
The ratio
private float _ratioField Value
_referenceAngleA
The reference angle
private readonly float _referenceAngleAField Value
_referenceAngleB
The reference angle
private readonly float _referenceAngleBField Value
_typeA
The type
private readonly JointType _typeAField Value
_typeB
The type
private readonly JointType _typeBField Value
Properties
JointA
The first revolute/prismatic joint attached to the gear joint.
public Joint JointA { get; }Property Value
JointB
The second revolute/prismatic joint attached to the gear joint.
public Joint JointB { get; }Property Value
Ratio
The gear ratio.
public float Ratio { 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
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