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 : Joint
Inheritance
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
bodyA
Body-
The first body
bodyB
Body-
The second body
jointA
Joint-
The first joint.
jointB
Joint-
The second joint.
ratio
float-
The ratio.
Fields
_JvAC
The jv bd
private Vector2 _JvAC
Field Value
_JvBD
The jv bd
private Vector2 _JvBD
Field Value
_JwA
The jw
private float _JwA
Field Value
_JwB
The jw
private float _JwB
Field Value
_JwC
The jw
private float _JwC
Field Value
_JwD
The jw
private float _JwD
Field Value
_bodyA
The body
private readonly Body _bodyA
Field Value
_bodyB
The body
private readonly Body _bodyB
Field Value
_bodyC
The body
private readonly Body _bodyC
Field Value
_bodyD
The body
private readonly Body _bodyD
Field Value
_constant
The constant
private readonly float _constant
Field Value
_iA
The
private float _iA
Field Value
_iB
The
private float _iB
Field Value
_iC
The
private float _iC
Field Value
_iD
The
private float _iD
Field Value
_impulse
The impulse
private float _impulse
Field Value
_indexA
The index
private int _indexA
Field Value
_indexB
The index
private int _indexB
Field Value
_indexC
The index
private int _indexC
Field Value
_indexD
The index
private int _indexD
Field Value
_lcA
The lc
private Vector2 _lcA
Field Value
_lcB
The lc
private Vector2 _lcB
Field Value
_lcC
The lc
private Vector2 _lcC
Field Value
_lcD
The lc
private Vector2 _lcD
Field Value
_localAnchorA
The local anchor
private readonly Vector2 _localAnchorA
Field Value
_localAnchorB
The local anchor
private readonly Vector2 _localAnchorB
Field Value
_localAnchorC
The local anchor
private readonly Vector2 _localAnchorC
Field Value
_localAnchorD
The local anchor
private readonly Vector2 _localAnchorD
Field Value
_localAxisC
The local axis
private Vector2 _localAxisC
Field Value
_localAxisD
The local axis
private Vector2 _localAxisD
Field Value
_mA
The
private float _mA
Field Value
_mB
The
private float _mB
Field Value
_mC
The
private float _mC
Field Value
_mD
The
private float _mD
Field Value
_mass
The mass
private float _mass
Field Value
_ratio
The ratio
private float _ratio
Field Value
_referenceAngleA
The reference angle
private readonly float _referenceAngleA
Field Value
_referenceAngleB
The reference angle
private readonly float _referenceAngleB
Field Value
_typeA
The type
private readonly JointType _typeA
Field Value
_typeB
The type
private readonly JointType _typeB
Field 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
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