Interface IParticleEmitterType
interface IParticleEmitterType {
applyToShader(uboOrEffect: UniformBufferEffectCommonAccessor): void;
buildUniformLayout(ubo: UniformBuffer): void;
clone(): IParticleEmitterType;
getClassName(): string;
getEffectDefines(): string;
parse(serializationObject: any, scene: Nullable<Scene>): void;
serialize(): any;
startDirectionFunction(
worldMatrix: Matrix,
directionToUpdate: Vector3,
particle: Particle,
isLocal: boolean,
inverseWorldMatrix: Matrix,
): void;
startPositionFunction(
worldMatrix: Matrix,
positionToUpdate: Vector3,
particle: Particle,
isLocal: boolean,
): void;
}
applyToShader(uboOrEffect: UniformBufferEffectCommonAccessor): void;
buildUniformLayout(ubo: UniformBuffer): void;
clone(): IParticleEmitterType;
getClassName(): string;
getEffectDefines(): string;
parse(serializationObject: any, scene: Nullable<Scene>): void;
serialize(): any;
startDirectionFunction(
worldMatrix: Matrix,
directionToUpdate: Vector3,
particle: Particle,
isLocal: boolean,
inverseWorldMatrix: Matrix,
): void;
startPositionFunction(
worldMatrix: Matrix,
positionToUpdate: Vector3,
particle: Particle,
isLocal: boolean,
): void;
}
Implemented by
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 a string representing the class name
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
the effect defines string
parse
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,
inverseWorldMatrix: Matrix,
): 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
- inverseWorldMatrix: Matrix
defines the inverted world matrix to use if isLocal is false
Returns void
- worldMatrix: Matrix
Particle emitter represents a volume emitting particles. This is the responsibility of the implementation to define the volume shape like cone/sphere/box.