AbstractRigidBodyComponent

AbstractRigidBodyComponent

Base class for rigid bodies.

Constructor

new AbstractRigidBodyComponent()

Members

joints :Array

Joints on the body. Use .addJoint to add one, or .removeJoint to remove.

Methods

addJoint(joint)

Parameters:
Name Type Description
joint PhysicsJoint

(abstract) destroy()

(abstract) destroyJoint(joint)

Removes a joint from the physics engine.

Parameters:
Name Type Description
joint PhysicsJoint

emitInitialized(entity)

Should be called by subclasses when initializing the physics engine body.

Parameters:
Name Type Description
entity Entity

(abstract) initialize()

Creates the physics engine rigid body and adds it to the simulation

(abstract) initializeJoint(joint, entity, system)

Creates a joint in the physics engine.

Parameters:
Name Type Description
joint PhysicsJoint
entity Entity
system System

removeJoint(joint)

Parameters:
Name Type Description
joint PhysicsJoint

traverseColliders(entity, callback)

Traverse the tree of colliders from a root entity and down.

Parameters:
Name Type Description
entity Entity
callback function

A callback to be called for each collider below or on the same entity. The arguments to the callback are: colliderEntity, collider, localPosition and localQuaternion.