Table of Contents

Class MotorJoint

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

A motor joint is used to control the relative motion between two bodies. A typical usage is to control the movement of a dynamic body with respect to the ground.

public class MotorJoint : Joint

Inheritance

Inherited Members

Constructors

MotorJoint()

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

internal MotorJoint()

MotorJoint(Body, Body, bool)

Constructor for MotorJoint.

public MotorJoint(Body bodyA, Body bodyB, bool useWorldCoordinates = false)

Parameters

bodyA Body

The first body

bodyB Body

The second body

useWorldCoordinates bool

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

Fields

_angularError

The angular error

private float _angularError

Field Value

float

_angularImpulse

The angular impulse

private float _angularImpulse

Field Value

float

_angularMass

The angular mass

private float _angularMass

Field Value

float

_angularOffset

The angular offset

private float _angularOffset

Field Value

float

_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

_linearError

The linear error

private Vector2 _linearError

Field Value

Vector2

_linearImpulse

The linear impulse

private Vector2 _linearImpulse

Field Value

Vector2

_linearMass

The linear mass

private Mat22 _linearMass

Field Value

Mat22

_linearOffset

The linear offset

private Vector2 _linearOffset

Field Value

Vector2

_localCenterA

The local center

private Vector2 _localCenterA

Field Value

Vector2

_localCenterB

The local center

private Vector2 _localCenterB

Field Value

Vector2

_maxForce

The max force

private float _maxForce

Field Value

float

_maxTorque

The max torque

private float _maxTorque

Field Value

float

_rA

The

private Vector2 _rA

Field Value

Vector2

_rB

The

private Vector2 _rB

Field Value

Vector2

invIa

The inv ia

private float invIa

Field Value

float

invIb

The inv ib

private float invIb

Field Value

float

Properties

AngularOffset

Get or set the angular offset.

public float AngularOffset { get; set; }

Property Value

float

CorrectionFactor

Gets or sets the value of the correction factor

internal float CorrectionFactor { get; set; }

Property Value

float

LinearOffset

The linear (translation) offset.

public Vector2 LinearOffset { get; set; }

Property Value

Vector2

MaxForce

The maximum amount of force that can be applied to BodyA

public float MaxForce { get; set; }

Property Value

float

MaxTorque

The maximum amount of torque that can be applied to BodyA

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