class nape.constraint.MotorJoint extends Constraint

Available on all platforms

MotorJoint constraining the angular velocities of two bodies *

* The equation for this constraint is: *

 * (ratio * body2.angularVel) - body1.angularVel = rate
 * 
* This constraint operates only on the velocities of objects.

Instance Fields

var body1:Null<Body>

First Body in constraint. *

* This value may be null, but trying to simulate the constraint whilst * this body is null will result in an error.

var body2:Null<Body>

Second Body in constraint. *

* This value may be null, but trying to simulate the constraint whilst * this body is null will result in an error.

var rate:Float

MotorJoint rate * * @default 0

var ratio:Float

MotorJoint ratio. * * @default 1

function new(body1:Null<Body>, body2:Null<Body>, ?rate:Float = 0.0f, ?ratio:Float = 1.0f):Void

Construct a new MotorJoint * *

body1

The first body in MotorJoint *

body2

The second body in MotorJoint *

rate

The rate of motor. (default 0) *

ratio

The ratio of the motor. (default 1) *

returns

The constructed MotorJoint.

function bodyImpulse(body:Body):Vec3

@inheritDoc *

* For this constraint, only the z coordinate will be non-zero.

function impulse():MatMN

@inheritDoc *

* For this constraint, the MatMN will be 1x1.

function visitBodies(lambda:Body ->Void):Void

@inheritDoc