three-nebula API
    Preparing search index...

    Class FollowEmitter

    Emitters are the System engine's particle factories. They cause particles to be rendered by emitting them, and store all particle initializers and behaviours.

    Hierarchy (View Summary)

    Index
    • The FollowEmitter will emit particles when the mouse moves.

      Parameters

      • OptionalmouseTarget: EventTarget
      • Optionalease: number
      • OptionalpObj: Record<string, unknown>

      Returns FollowEmitter

    _allowEmitting: boolean
    acceleration: Vector3D
    age: number
    alpha: number
    behaviours: Behaviour[]
    bindEmitter: boolean
    bindEmitterEvent: boolean
    body: unknown
    camera?: Camera
    canvas?: HTMLCanvasElement
    cID: number
    color: RGB
    currentEmitTime: number
    damping: number
    dead: boolean
    distanceToCamera: number
    ease: number
    emitterBehaviours: Behaviour[]
    energy: number
    eventDispatcher: EventDispatcher
    hasBeenInitialized?: boolean
    id: string
    index?: number
    initializers: Initializer[]
    isEmitting: boolean
    life: number
    mass: number
    mousemoveHandler: (e: Event) => void
    mouseTarget: EventTarget
    name: string
    old: { acceleration: Vector3D; position: Vector3D; velocity: Vector3D }
    parent: Emitter | System | null
    particles: Particle[]
    position: Vector3D
    radius: number
    rate: Rate
    rotation: Vector3D
    scale: number
    sleep: boolean
    target?: unknown
    totalEmitTimes: number
    transform: Record<string, unknown>
    type: string
    useAlpha: boolean
    useColor: boolean
    velocity: Vector3D
    • get system(): System | null

      An emitter's parent is the System it was added to (a particle's parent is its emitter, hence the inherited parent field is narrowed here).

      Returns System | null

    • Proxy method for the internal event dispatcher's dispatchEvent method.

      Parameters

      • event: string
      • target: unknown = ...

      Returns void

    • Resets the particle's default properties and clears its position, velocity, acceleration, color and rotation.

      Returns this

    • Parameters

      • camera: Camera
      • canvas: HTMLCanvasElement

      Returns void

    • Sets up a particle by running all initializers on it and setting its behaviours. Also adds the particle to this.particles.

      Parameters

      • particle: Particle
      • Optionalindex: number

      Returns void

    • Updates the emitter according to the time passed by calling the generate and integrate methods.

      Parameters

      • time: number

      Returns void