Constructor
new ParticleEmitter()
- Source:
Example
const emitter = new THING.ParticleEmitter();
emitter.particleCount = 100;
emitter.distribution = 1;
emitter.duration = 2;
emitter.isLookAtCamera = true;
emitter.isLookAtCameraY = true;
emitter.wiggle = {
spread:0,
value:0
};
emitter.rotation = {
axisSpread:[0, 0, 0],
randomise:false,
angleSpread:0,
center:[0, 0, 0],
angle:0,
static:false,
axis:[0, 1, 0]
};
emitter.velocity = {
randomise:false,
value:[0, 25, 0],
distribution:1,
spread:[10, 7.5, 10]
};
emitter.size = {
randomise:[false, false],
spread:[0, 0],
value:[2, 0]
};
emitter.angle = {
randomise:[false, false],
spread:[0, 0],
value:[1, 0]
};
emitter.opacity = {
randomise:[false, false],
spread:[0, 0],
value:[1, 0.1]
};
emitter.color = {
randomise:[false, false],
spread:[[0, 0, 0], [0, 0, 0]],
value:[[0, 0, 0], [1, 1, 0]]
};
emitter.acceleration = {
randomise:false,
value:[0, -10, 0],
distribution:1,
spread:[0, 0, 0]
};
emitter.maxAge = {
spread:0,
value:2
};
emitter.position = {
randomise:false,
radius:10,
spreadClamp:[0, 0, 0],
value:[0, 0, -50],
radiusScale:[1, 1, 1],
distribution:1,
spread:[0, 0, 0]
};
emitter.drag = {
randomise:false,
spread:0,
value:0
};
Members
acceleration :Acceleration
Get acceleration.
Type:
- Source:
activeMultiplier :Number
Get/Set active multiplier.A value between 0 and 1 describing what percentage of this particle's particlesPerSecond should be emitted, where 0 is 0%, and 1 is 100%.
Type:
- Number
- Source:
angle :ListAngle
Get angle.
Type:
- Source:
color :ListColor
Get color.
Type:
- Source:
direction :Number
Get/Set direction.The direction of the particle. If value is `1`, particle will start at beginning of particle's lifecycle.If value is `-1`, particle will start at end of particle's lifecycle and work it's way backwards.
Type:
- Number
- Source:
distribution :Number
Get/Set distribution.It use to control its particle's spawn position and force behaviour.The options are 1(Box),2(Sphere),3(Disc),4(Line).
Type:
- Number
- Source:
drag :Drag
Get drag attribute.
Type:
- Source:
duration :Number|null
Get/Set duration.The duration in seconds that this emitter should live for.If not specified, the emitter will emit particles indefinitely.
Type:
- Number | null
- Source:
isLookAtCamera :Boolean
Get/Set IsLookAtCamera.It takes effect when UseMesh is true.True indicates its particle will always look at camera.
Type:
- Boolean
- Source:
isLookAtCameraY :Boolean
Get/Set IsLookAtCamera.It takes effect when UseMesh is true.True indicates its particle will always look at camera and lock y-axis.
Type:
- Boolean
- Source:
isStatic :Boolean
Get/Set isStatic.True indicates these particles should be not be simulated.
Type:
- Boolean
- Source:
maxAge :MaxAge
Get/Set maxAge attribute.
Type:
- Source:
opacity :ListOpacity
Get opacity.
Type:
- Source:
particleCount :Number
Get/Set particle count.The count of particle when rendering.
Type:
- Number
- Source:
position :Position
Get position.
Type:
- Source:
rotation :Rotation
Get rotation.
Type:
- Source:
size :ListSize
Get size.
Type:
- Source:
velocity :Velocity
Get velocity.
Type:
- Source:
Methods
getAttribute(key) → {any}
Get attribute.
Parameters:
Name | Type | Description |
---|---|---|
key |
ParticleEmitterAttributeType | The key |
- Source:
Returns:
- Type
- any
setAttribute(key, value)
Set attribute.
Parameters:
Name | Type | Description |
---|---|---|
key |
ParticleEmitterAttributeType | The key |
value |
any | The value. |
- Source: