Class RotationalMotorEquation

Rotational motor constraint. Tries to keep the relative angular velocity of the bodies to a given value.

Hierarchy (view full)

Constructors

Properties

a: number

SPOOK parameter

axisA: Vec3

World oriented rotational axis.

axisB: Vec3

World oriented rotational axis.

b: number

SPOOK parameter

bi: Body
bj: Body
enabled: boolean
eps: number

SPOOK parameter

id: number
jacobianElementA: JacobianElement
jacobianElementB: JacobianElement
maxForce: number

Maximum (read: positive max) force to be applied by the constraint.

minForce: number

Minimum (read: negative max) force to be applied by the constraint.

multiplier: number

A number, proportional to the force added to the bodies.

si: Shape
sj: Shape
targetVelocity: number

Motor velocity.

idCounter: number

Methods

  • Add constraint velocity to the bodies.

    Parameters

    • deltalambda: number

    Returns void

  • Computes the right hand side of the SPOOK equation

    Parameters

    • h: number

    Returns number

  • Compute the denominator part of the SPOOK equation: C = G*inv(M)*G' + eps

    Returns number

  • Computes G*W, where W are the body velocities

    Returns number

  • Computes G*Wlambda, where W are the body velocities

    Returns number

  • Computes G*inv(M)*f, where M is the mass matrix with diagonal blocks for each body, and f are the forces on the bodies.

    Returns number

  • Computes G*q, where q are the generalized body coordinates

    Returns number

  • Recalculates a, b, and eps.

    The Equation constructor sets typical SPOOK parameters as such:

    • stiffness = 1e7
    • relaxation = 4
    • timeStep= 1 / 60, note the hardcoded refresh rate.

    Parameters

    • stiffness: number
    • relaxation: number
    • timeStep: number

    Returns void