PhysicsEventData

lumin. PhysicsEventData

Extends

Methods

getBody1CollisionMaterial(collision) → {lumin.PhysicsMaterial}

Returns the material for body 1 at a collision.

Parameters:
Name Type Description
collision number

Collision index of the material.

Returns:
Type
lumin.PhysicsMaterial

getBody2CollisionMaterial(collision) → {lumin.PhysicsMaterial}

Returns the material for body 2 at a collision.

Parameters:
Name Type Description
collision number

Collision index of the material.

Returns:
Type
lumin.PhysicsMaterial

getCollisionCount() → {number}

Returns the number of collisions.

Returns:
Type
number

getCollisionForces() → {Array.<vec3>}

Returns collision forces, in Newtons (kg-m/s^2)

Returns:
Type
Array.<vec3>

getCollisionNormals() → {Array.<vec3>}

Collision normals are in volume-space

Returns:
Type
Array.<vec3>

getCollisionPoints() → {Array.<vec3>}

Returns collision points, in prism-space

Returns:
Type
Array.<vec3>

getCollisionType() → {lumin.physics.CollisionType}

Returns the type of collision event being reported.

Returns:
Type
lumin.physics.CollisionType

getPrismId() → {number}

Inherited From:

Returns the Prism ID of the target Prism.

Returns:

the Prism ID of the target Prism.

Type
number

getRigidBody1() → {number}

Returns id of the 1st colliding rigid body.
If this is a trigger event, this will be the trigger body.
If this body is the world mesh, the id will be 0.

Returns:
Type
number

getRigidBody2() → {number}

Returns id of the 2nd colliding rigid body.
If this body is the world mesh, the id will be 0.

Returns:
Type
number

isInputEventType() → {boolean}

Inherited From:

Returns true if this is an input event (a subclass of InputEventData).

Returns:

true if this is an input event

Type
boolean

toString() → {string}

Inherited From:

Returns a string representation of this event for debug purposes.

Returns:
Type
string