three-nebula API
    Preparing search index...

    Class Rotate

    Behaviour that rotates particles.

    Hierarchy (View Summary)

    Index
    • Constructs a Rotate behaviour instance.

      Parameters

      • x: number

        X axis rotation

      • y: number

        Y axis rotation

      • z: number

        Z axis rotation

      • Optionallife: number

        The life of the behaviour

      • Optionaleasing: EasingFunction

        The easing equation to use for transforms

      • isEnabled: boolean = true

        Determines if the behaviour will be applied or not

      Returns Rotate

    _life: number
    _rotationType: string
    age: number
    dead: boolean
    energy: number
    id: string
    isEnabled: boolean
    type: string
    x: number | Span<number>
    y: number | Span<number>
    z: number | Span<number>
    • get life(): number

      Gets the behaviour's life.

      Returns number

    • set life(life: number): void

      Ensures that life is infinity if an invalid value is supplied.

      Parameters

      • life: number

      Returns void

    • Sets the particle's rotation prior to the behaviour being applied.

      NOTE It's hard to see here, but this is mutating the particle's rotation even though the particle is not being passed in directly.

      NOTE the else if below will never be reached because the value being passed in will never be of type Vector3D.

      Parameters

      • particleRotation: Vector3D

        the particle's rotation vector

      • value: string | number | Span<number>

        the value to set the rotation value to, if 'random' rotation is randomised

      Returns void

    • Compares the age of the behaviour vs integration time and determines if the behaviour should be set to dead or not.

      Parameters

      • particle: Particle
      • time: number
      • Optionalindex: number

      Returns void

    • Returns a new instance of the behaviour from the JSON object passed.

      Parameters

      • json: Record<string, unknown>

      Returns void

    • Resets the behaviour properties.

      Parameters

      • x: number

        X axis rotation

      • Optionaly: number

        Y axis rotation

      • Optionalz: number

        Z axis rotation

      • Optionallife: number

        the life of the behaviour

      • Optionaleasing: EasingFunction

        the easing equation to use for transforms

      Returns void