Module: util
Classes#
Variables#
despawningRules#
• Const despawningRules: Object
Contains a set of pre-defined particle despawning rules.
Type declaration#
| Name | Type |
|---|---|
bounds | (particle: Particle) => boolean |
lifetime | (particle: Particle) => boolean |
Defined in#
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#
| Name | Type |
|---|---|
defaults | T |
overrides? | Partial<T> |
Returns#
T
Defined in#
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#
| Name | Type | Description |
|---|---|---|
rotation | Vector | The euler rotation angles (in degrees) to calculate the normal for. |