PhysicsMaterial

lumin. PhysicsMaterial

Data representing the surface properties of a PhysicsShape. There are 3 values:

Static friction : Friction applied to the body if it is not in motion. Most sliding bodies have
a higher friction when stationary than when moving.
Dynamic friction : Friction applied to the body if it is in motion.
Restitution : Measure of how much relative energy a body has after a collision. A value of 0
means all energy is lost, 1 means no energy is lost. Can be considered how
"bouncy" a body is.

Constructor

new PhysicsMaterial(staticFriction, dynamicFriction, restitution)

Constructor

Parameters:
Name Type Description
staticFriction number

Friction for resting bodies.

dynamicFriction number

Friction for moving bodies.

restitution number

Measure of the amount of energy the body has after a collision.

Methods

getDynamicFriction() → {number}

Returns the dynamic friction.

Returns:

dynamic friction

Type
number

getRestitution() → {number}

Returns the restitution.

Returns:

restitution

Type
number

getStaticFriction() → {number}

Returns the static friction.

Returns:

static friction

Type
number

lumin. PhysicsMaterial

new PhysicsMaterial()

Default constructor. Creates a material with light friction and no restitution.

Methods

getDynamicFriction() → {number}

Returns the dynamic friction.

Returns:

dynamic friction

Type
number

getRestitution() → {number}

Returns the restitution.

Returns:

restitution

Type
number

getStaticFriction() → {number}

Returns the static friction.

Returns:

static friction

Type
number