API

Class CustomParticleEmitter

Particle emitter emitting particles from a custom list of positions.

Implements

Index
particleDestinationGenerator: (
    index: number,
    particle: Nullable<Particle>,
    outDestination: Vector3,
) => void = EmptyGeneratorFunc

Gets or sets the destination generator that will create the final destination of each particle.

  • Index will be provided when used with GPU particle. Particle will be provided when used with CPU particles
particleDirectionGenerator: (
    index: number,
    particle: Nullable<Particle>,
    outDestination: Vector3,
) => void = EmptyGeneratorFunc

Gets or sets the direction generator that will create the initial direction of each particle.

  • Index will be provided when used with GPU particle. Particle will be provided when used with CPU particles
particlePositionGenerator: (
    index: number,
    particle: Nullable<Particle>,
    outPosition: Vector3,
) => void = EmptyGeneratorFunc

Gets or sets the position generator that will create the initial position of each particle. Index will be provided when used with GPU particle. Particle will be provided when used with CPU particles

  • Called by the particle System when the direction is computed for the created particle.

    Parameters

    • worldMatrix: Matrix

      is the world matrix of the particle system

    • directionToUpdate: Vector3

      is the direction vector to update with the result

    • particle: Particle

      is the particle we are computed the direction for

    • isLocal: boolean

      defines if the direction should be set in local space

    Returns void

  • Called by the particle System when the position is computed for the created particle.

    Parameters

    • worldMatrix: Matrix

      is the world matrix of the particle system

    • positionToUpdate: Vector3

      is the position vector to update with the result

    • particle: Particle

      is the particle we are computed the position for

    • isLocal: boolean

      defines if the position should be set in local space

    Returns void