SolidParticle

Description

class SolidParticle

Constructor

new SolidParticle(particleIndex, positionIndex, indiceIndex, model, shapeId, idxInShape, sps, modelBoundingInfo)

Creates a Solid Particle object.

Don't create particles manually, use instead the Solid Particle System internal tools like _addParticle()

particleIndex (integer) is the particle index in the Solid Particle System pool. It's also the particle identifier.

positionIndex (integer) is the starting index of the particle vertices in the SPS "positions" array.

indiceIndex (integer) is the starting index of the particle indices in the SPS "indices" array.

model (ModelShape) is a reference to the model shape on what the particle is designed.

shapeId (integer) is the model shape identifier in the SPS.

idxInShape (integer) is the index of the particle in the current model (ex: the 10th box of addShape(box, 30))

modelBoundingInfo is the reference to the model BoundingInfo used for intersection computations.

Parameters

Name Type Description
particleIndex number
positionIndex number
indiceIndex number
model Nullable<ModelShape>
shapeId number
idxInShape number
sps SolidParticleSystem

Members

idx : number

color : Nullable<Color4>

position : Vector3

rotation : Vector3

rotationQuaternion : Nullable<Quaternion>

scaling : Vector3

uvs : Vector4

velocity : Vector3

pivot : Vector3

alive : boolean

isVisible : boolean

shapeId : number

idxInShape : number

scale : Vector3

legacy support, changed scale to scaling

quaternion : Nullable<Quaternion>

legacy support, changed quaternion to rotationQuaternion

Methods

intersectsMesh(target, SolidParticle) boolean

Returns a boolean. True if the particle intersects another particle or another mesh, else false.

The intersection is computed on the particle bounding sphere and Axis Aligned Bounding Box (AABB)

target is the object (solid particle or mesh) what the intersection is computed against.

Parameters

Name Type Description
target Mesh or SolidParticle