Class ConeParticleEmitter
Hierarchy (View Summary)
- ConeParticleEmitter
Implements
Constructors
constructor
-
new ConeParticleEmitter(
radius?: number,
angle?: number,
directionRandomizer?: number,
): ConeParticleEmitterCreates a new instance ConeParticleEmitter
Parameters
- radius: number = 1
the radius of the emission cone (1 by default)
- angle: number = Math.PI
the cone base angle (PI by default)
- directionRandomizer: number = 0
defines how much to randomize the particle direction [0-1] (default is 0)
Returns ConeParticleEmitter
- radius: number = 1
Properties
direction Randomizer
[0] defines how much to randomize the particle direction [0-1] (default is 0)
emit From Spawn Point Only
Gets or sets a value indicating if all the particles should be emitted from the spawn point only (the base of the cone)
height Range
Gets or sets a value indicating where on the height the start position should be picked (1 = everywhere, 0 = only surface)
radius Range
Gets or sets a value indicating where on the radius the start position should be picked (1 = everywhere, 0 = only surface)
Accessors
angle
-
get angle(): number
Gets or sets the angle of the emission cone
Returns number
-
set angle(value: number): void
Parameters
- value: number
Returns void
radius
-
get radius(): number
Gets or sets the radius of the emission cone
Returns number
-
set radius(value: number): void
Parameters
- value: number
Returns void
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 "ConeParticleEmitter"
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 the inside of a cone. It emits the particles alongside the cone volume from the base to the particle. The emission direction might be randomized.