Class: ParticleGroup

THING.ParticleGroup()

ParticleGroup The particle group.

Constructor

new ParticleGroup()

Source:
Example
const group = new THING.ParticleGroup();
group.maxParticleCount = 200;
group.useMesh = false;
group.meshUrl = "BuildIn/Box";
group.texture = {
	url:"./particle.png"
};
group.blendingMode = "normal";
group.isTransparent = true;
group.alphaTest = true;
group.depthWrite = false;
group.depthTest = false;
group.url = "./particle.png";

Members

alphaTest :Number

Get/Set alphaTest.Sets the alpha value to particle. Value between 0 and 1.
Type:
  • Number
Source:

blendingMode :String

Get/Set blend mode.The blend mode of these particle.The options are 'none', 'normal', 'add', 'sub', 'mul', 'custom'.
Type:
  • String
Source:

depthTest :Boolean

Get/Set depthTest.Sets the depthTest to particle.
Type:
  • Boolean
Source:

depthWrite :Boolean

Get/Set depthWrite.Sets the depthWrite to particle.
Type:
  • Boolean
Source:

emitters :Array.<ParticleEmitter>

Get emitters.
Type:
  • Array.<ParticleEmitter>
Source:

fog :Boolean

Get/Set fog.True indicates these particles should be affected by their scene's fog.
Type:
  • Boolean
Source:

isColorize :Boolean

Get/Set isColorize.True indicates these particles should be rendered with color, or the only color of particles will come from the provided texture.
Type:
  • Boolean
Source:

isTransparent :Boolean

Get/Set isTransparent.True indicates these particle's should be rendered with transparency.
Type:
  • Boolean
Source:

maxParticleCount :Number

Get/Set maxParticleCount.The max count of these particle.
Type:
  • Number
Source:

meshParams :Array

Get/Set mesh parmas.It takes effect when UseMesh is true, and indicates particle mesh type's attribute.
Type:
  • Array
Source:

meshUrl :String

Get/Set mesh url.It takes effect when UseMesh is true, and indicates particle mesh type.The options are 'BuildIn/Box', 'BuildIn/Plane', 'BuildIn/Sphere'.
Type:
  • String
Source:

texture :ImageTextureResource

Get/Set texture.The image value of particle.
Type:
  • ImageTextureResource
Source:

textureAnimation :TextureAnimation

Get/Set textureAnimation.
Type:
Source:

url :String

Get/Set texture url.The image url of particle.
Type:
  • String
Source:

useMesh :Boolean

Get/Set useMesh.True indicates these particle use mesh but not points.
Type:
  • Boolean
Source:

Methods

addEmitter(emitter) → {ParticleEmitter}

Add emitter.
Parameters:
Name Type Description
emitter ParticleEmitter The emitter.
Source:
Returns:
Type
ParticleEmitter
Example
const emitter = new THING.ParticelEmitter();
group.addEmitter(emitter);

getAttribute(key) → {any}

Get attribute.
Parameters:
Name Type Description
key ParticleGroupAttributeType The key.
Source:
Returns:
Type
any

removeEmitter(emitter)

Remove emitter by ParticleEmitter.
Parameters:
Name Type Description
emitter ParticleEmitter The emitter.
Source:
Example
const emitter = group.getEmitters();
group.removeEmitter(emitter);

setAttribute(key, value)

Set attribute.
Parameters:
Name Type Description
key ParticleGroupAttributeType The key.
value any The value.
Source: