MotorJoint

Constraintnape.constraint.MotorJoint (final class)

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 Members

@private


nape
body1: Null<nape.phys.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.


nape
body2: Null<nape.phys.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.


nape
ratio: Float

MotorJoint ratio.

@default 1


nape
rate: Float

MotorJoint rate

@default 0


nape
impulse(): nape.geom.MatMN

@inheritDoc

For this constraint, the MatMN will be 1x1.

Returns
nape.geom.MatMN

nape
bodyImpulse(body: nape.phys.Body): nape.geom.Vec3

@inheritDoc

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

Name Type
body nape.phys.Body
Returns
nape.geom.Vec3

nape
visitBodies(lambda: Function): Void

@inheritDoc

Name Type
lambda Function

nape
new(body1: Null<nape.phys.Body>, body2: Null<nape.phys.Body>, ?rate: Float = 0.0, ?ratio: Float = 1.0): Void

Construct a new MotorJoint

Name Type Default Description
body1 Null<nape.phys.Body> The first body in MotorJoint
body2 Null<nape.phys.Body> The second body in MotorJoint
rate Float 0.0 The rate of motor. (default 0)
ratio Float 1.0 The ratio of the motor. (default 1)

Private Members

Metadata

Name Parameters
:final -