Class CustomParticleEmitter
Implements
Constructors
constructor
-
Creates a new instance CustomParticleEmitter
Returns CustomParticleEmitter
Properties
particle Destination Generator
index: number,
particle: Nullable<Particle>,
outDestination: Vector3,
) => void = EmptyGeneratorFunc
Gets or sets the destination generator that will create the final destination of each particle.
- Index will be provided when used with GPU particle. Particle will be provided when used with CPU particles
particle Direction Generator
index: number,
particle: Nullable<Particle>,
outDestination: Vector3,
) => void = EmptyGeneratorFunc
Gets or sets the direction generator that will create the initial direction of each particle.
- Index will be provided when used with GPU particle. Particle will be provided when used with CPU particles
particle Position Generator
index: number,
particle: Nullable<Particle>,
outPosition: Vector3,
) => void = EmptyGeneratorFunc
Gets or sets the position generator that will create the initial position of each particle. Index will be provided when used with GPU particle. Particle will be provided when used with CPU particles
Methods
apply To Shader
-
Called by the GPUParticleSystem to setup the update shader
Parameters
- uboOrEffect: UniformBufferEffectCommonAccessor
defines the update shader
Returns void
- uboOrEffect: UniformBufferEffectCommonAccessor
build Uniform Layout
-
Creates the structure of the ubo for this particle emitter
Parameters
- ubo: UniformBuffer
ubo to create the structure for
Returns void
- ubo: UniformBuffer
clone
get Class Name
-
Returns the string "PointParticleEmitter"
Returns string
a string containing the class name
get Effect Defines
-
Returns a string to use to update the GPU particles update shader
Returns string
a string containing the defines string
parse
-
Parse properties from a JSON object
Parameters
- serializationObject: any
defines the JSON object
Returns void
- serializationObject: any
serialize
-
Serializes the particle system to a JSON object.
Returns any
the JSON object
start Direction Function
-
startDirectionFunction(
worldMatrix: Matrix,
directionToUpdate: Vector3,
particle: Particle,
isLocal: boolean,
): voidCalled by the particle System when the direction is computed for the created particle.
Parameters
- worldMatrix: Matrix
is the world matrix of the particle system
- directionToUpdate: Vector3
is the direction vector to update with the result
- particle: Particle
is the particle we are computed the direction for
- isLocal: boolean
defines if the direction should be set in local space
Returns void
- worldMatrix: Matrix
start Position Function
-
startPositionFunction(
worldMatrix: Matrix,
positionToUpdate: Vector3,
particle: Particle,
isLocal: boolean,
): voidCalled by the particle System when the position is computed for the created particle.
Parameters
- worldMatrix: Matrix
is the world matrix of the particle system
- positionToUpdate: Vector3
is the position vector to update with the result
- particle: Particle
is the particle we are computed the position for
- isLocal: boolean
defines if the position should be set in local space
Returns void
- worldMatrix: Matrix
Particle emitter emitting particles from a custom list of positions.