Class: RigidBody

RigidBody

RigidBody is a component allowing a scene graph object to have physics simulations applied to it. Requires PhysicsSystem. At this point, entities using RigidBody need to be added to the root of the scenegraph (or have parents without transformations)! Broadcasts a "collision" message on the Entity when a collision occurs with a Collision object as parameter. This Collision object is shared across collisions and therefor is only valid in the callback method.


new RigidBody(collider, mass, material)

Parameters:
Name Type Description
collider

The Collider type describing the shape of how to object interacts with the world. If omitted, it will take a shape based on the type of bounds assigned to the target object.

mass

The mass of the target object. If omitted, it will venture a guess based on the bounding volume.*

material

An optional PhysicsMaterial defining the friction and restitution parameters of the surface

Properties:
Name Type Description
isKinematic boolean

When set to true, the user indicates the position of the object will be updated manually as opposed to by the physics engine.

ignoreRotation boolean

When set to true, the rigid body does not take on the rotation of its entity. This is useful for a player controller camera.

ignoreRotation Number

The mass of the target object.

linearDamping Number

How much an object linear movement slows down over time

angularDamping Number

How much an object rotational movement slows down over time

material PhysicsMaterial

The PhysicsMaterial defining friction and restitution.

angularVelocity Float4

The current angular velocity of the rigid body.

linearVelocity Float4

The current linear velocity of the rigid body.

Author:
  • derschmale <http://www.derschmale.com>

Members


<static> COLLISION_MESSAGE

The name of the message broadcast by this component