API

Class Hinge2Joint

This class represents a dual hinge physics joint (same as wheel joint)

Hierarchy (View Summary)

Index
jointData: PhysicsJointData

The data for the physics joint

type: number

The type of the physics joint

BallAndSocketJoint: number = 2

Ball-and-Socket joint type

DistanceJoint: number = 0

Distance-Joint type

Hinge2Joint: number = PhysicsJoint.WheelJoint

Hinge-Joint 2 type

HingeJoint: number = 1

Hinge-Joint type

LockJoint: number = 10

Lock-Joint type

PointToPointJoint: number = 8

Point to Point Joint type. Similar to a Ball-Joint. Different in parameters

PrismaticJoint: number = 5

Prismatic-Joint type

SliderJoint: number = 4

Slider-Joint type

SpringJoint: number = 9

Spring-Joint type

UniversalJoint: number = 6

Universal-Joint type ENERGY FTW! (compare with this -

WheelJoint: number = 3

Wheel-Joint type

  • set physicsPlugin(physicsPlugin: IPhysicsEnginePlugin): void

    Sets the physics plugin

    Parameters

    • physicsPlugin: IPhysicsEnginePlugin

    Returns void

  • Set the motor limits. Attention, this function is plugin specific. Engines won't react 100% the same.

    Parameters

    • upperLimit: number

      the upper limit

    • OptionallowerLimit: number

      lower limit

    • motorIndex: number = 0

      the motor's index, 0 or 1.

    Returns void

  • Set the motor values. Attention, this function is plugin specific. Engines won't react 100% the same.

    Parameters

    • OptionaltargetSpeed: number

      the speed the motor is to reach

    • OptionalmaxForce: number

      max force for this motor.

    • motorIndex: number = 0

      motor's index, 0 or 1.

    Returns void