Table of Contents

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

Vector2

_JvBD

The jv bd

private Vector2 _JvBD

Field Value

Vector2

_JwA

The jw

private float _JwA

Field Value

float

_JwB

The jw

private float _JwB

Field Value

float

_JwC

The jw

private float _JwC

Field Value

float

_JwD

The jw

private float _JwD

Field Value

float

_bodyA

The body

private readonly Body _bodyA

Field Value

Body

_bodyB

The body

private readonly Body _bodyB

Field Value

Body

_bodyC

The body

private readonly Body _bodyC

Field Value

Body

_bodyD

The body

private readonly Body _bodyD

Field Value

Body

_constant

The constant

private readonly float _constant

Field Value

float

_iA

The

private float _iA

Field Value

float

_iB

The

private float _iB

Field Value

float

_iC

The

private float _iC

Field Value

float

_iD

The

private float _iD

Field Value

float

_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

_indexC

The index

private int _indexC

Field Value

int

_indexD

The index

private int _indexD

Field Value

int

_lcA

The lc

private Vector2 _lcA

Field Value

Vector2

_lcB

The lc

private Vector2 _lcB

Field Value

Vector2

_lcC

The lc

private Vector2 _lcC

Field Value

Vector2

_lcD

The lc

private Vector2 _lcD

Field Value

Vector2

_localAnchorA

The local anchor

private readonly Vector2 _localAnchorA

Field Value

Vector2

_localAnchorB

The local anchor

private readonly Vector2 _localAnchorB

Field Value

Vector2

_localAnchorC

The local anchor

private readonly Vector2 _localAnchorC

Field Value

Vector2

_localAnchorD

The local anchor

private readonly Vector2 _localAnchorD

Field Value

Vector2

_localAxisC

The local axis

private Vector2 _localAxisC

Field Value

Vector2

_localAxisD

The local axis

private Vector2 _localAxisD

Field Value

Vector2

_mA

The

private float _mA

Field Value

float

_mB

The

private float _mB

Field Value

float

_mC

The

private float _mC

Field Value

float

_mD

The

private float _mD

Field Value

float

_mass

The mass

private float _mass

Field Value

float

_ratio

The ratio

private float _ratio

Field Value

float

_referenceAngleA

The reference angle

private readonly float _referenceAngleA

Field Value

float

_referenceAngleB

The reference angle

private readonly float _referenceAngleB

Field Value

float

_typeA

The type

private readonly JointType _typeA

Field Value

JointType

_typeB

The type

private readonly JointType _typeB

Field Value

JointType

Properties

JointA

The first revolute/prismatic joint attached to the gear joint.

public Joint JointA { get; }

Property Value

Joint

JointB

The second revolute/prismatic joint attached to the gear joint.

public Joint JointB { get; }

Property Value

Joint

Ratio

The gear ratio.

public float Ratio { 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

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