SolidParticle

Represents one particle of a solid particle system.

Hierarchy

  • SolidParticle

Index

Constructors

constructor

Find examples in Playground
  • Creates a Solid Particle object. Don't create particles manually, use instead the Solid Particle System internal tools like _addParticle()

    Parameters

    • particleIndex: number

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

    • positionIndex: number

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

    • indiceIndex: number

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

    • model: Nullable<ModelShape>

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

    • shapeId: number

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

    • idxInShape: number

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

    • sps: SolidParticleSystem
    • Optional modelBoundingInfo: Nullable<BoundingInfo>

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

    Returns SolidParticle

Properties

alive

Find examples in Playground
alive: boolean

Is the particle active or not ?

color

Find examples in Playground

The color of the particle

idx

Find examples in Playground
idx: number

particle global index

idxInShape

Find examples in Playground
idxInShape: number

Index of the particle in its shape id (Internal use)

isVisible

Find examples in Playground
isVisible: boolean

Is the particle visible or not ?

parentId

Find examples in Playground
parentId: Nullable<number>

Parent particle Id, if any. Default null.

pivot

Find examples in Playground
pivot: Vector3

The pivot point in the particle local space.

position

Find examples in Playground
position: Vector3

The world space position of the particle.

quaternion

Find examples in Playground
quaternion: Nullable<Quaternion>

Legacy support, changed quaternion to rotationQuaternion

rotation

Find examples in Playground
rotation: Vector3

The world space rotation of the particle. (Not use if rotationQuaternion is set)

rotationQuaternion

Find examples in Playground
rotationQuaternion: Nullable<Quaternion>

The world space rotation quaternion of the particle.

scale

Find examples in Playground
scale: Vector3

Legacy support, changed scale to scaling

scaling

Find examples in Playground
scaling: Vector3

The scaling of the particle.

shapeId

Find examples in Playground
shapeId: number

ModelShape id of this particle

translateFromPivot

Find examples in Playground
translateFromPivot: boolean

Must the particle be translated from its pivot point in its local space ? In this case, the pivot point is set at the origin of the particle local space and the particle is translated. Default : false

uvs

Find examples in Playground
uvs: Vector4

The uvs of the particle.

velocity

Find examples in Playground
velocity: Vector3

The current speed of the particle.

Methods

intersectsMesh

Find examples in Playground
  • 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)

    Parameters

    • target: Mesh | SolidParticle

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

    Returns boolean

    true if it intersects

Generated using TypeDoc