Skip to main content

Module: util

Classes#

Variables#

despawningRules#

• Const despawningRules: Object

Contains a set of pre-defined particle despawning rules.

Type declaration#

NameType
bounds(particle: Particle) => boolean
lifetime(particle: Particle) => boolean

Defined in#

util/rules.ts:6

Functions#

overrideDefaults#

â–¸ overrideDefaults<T>(defaults, overrides?): T

Replaces the supplied defaults with the properties specified in the overrides. This returns a new object.

Type parameters#

Name
T

Parameters#

NameType
defaultsT
overrides?Partial<T>

Returns#

T

Defined in#

util/config.ts:5


rotationToNormal#

â–¸ rotationToNormal(rotation): Vector

Converts the specified euler rotation (in degrees) into the corresponding normal vector.

remarks The normal is calculated by placing a (figurative) plane in a coordinate-system's origin, and rotating it by the specified angles. Note that the z-component of the rotation is irrelevant for the normal and can be ignored. Then, two vectors describing the orientation of the plane are calculated. Their cross product denotes the normal vector.

Parameters#

NameTypeDescription
rotationVectorThe euler rotation angles (in degrees) to calculate the normal for.

Returns#

Vector

Defined in#

util/rotation.ts:16