ParticleSystem(param)

new ParticleSystem(param)

粒子系统对象构造函数。
Parameters:
Name Type Description
param object 初始参数。
Properties
Name Type Attributes Description
url string <optional>
粒子系统资源的URL路径。
data object <optional>
粒子系统数据对象,包含粒子系统的配置和属性。其他参数与 THING.BaseTickableObject3D 的构造函数相同。请在 THING.BaseTickableObject3D 的文档中查看构造函数部分以获取详细参数列表。

Members

groups :Array.<ParticleGroup>

获取粒子组

isParticleSystem :boolean

检查是否为粒子系统类型或继承自粒子系统类型

Methods

addGroup(group) → {ParticleGroup|undefined}

添加粒子组。
Parameters:
Name Type Description
group ParticleGroup 粒子组。
Returns:
ParticleGroup | undefined - 返回添加的粒子组。
Example
const group = new THING.ParticleGroup();
	particleSystem.addGroup(group);

getParticleData(param) → {object}

获取当前粒子系统的数据。
Parameters:
Name Type Description
param object { dataVersion2:false } 当dataVersion2为true时,获取ThingJS 2.0的数据。
Returns:
object - 粒子系统的数据
Example
const data = particleSystem.getParticleData({ dataVersion2:false });

removeGroup(group)

移除粒子组。
Parameters:
Name Type Description
group ParticleGroup 粒子组。
Example
const groups = particleSystem.getGroups();
	particleSystem.removeGroup(groups[0]);