three-nebula API
    Preparing search index...

    Class Scale

    Behaviour that scales particles.

    Hierarchy (View Summary)

    Index
    • Constructs a Scale behaviour instance.

      Parameters

      • OptionalscaleA: number

        the starting scale value

      • OptionalscaleB: number

        the ending scale value

      • 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 Scale

    _life: number
    _same: boolean
    age: number
    dead: boolean
    energy: number
    id: string
    isEnabled: boolean
    scaleA: Span<number>
    scaleB: Span<number>
    type: string
    • 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

    • get same(): boolean

      Gets the _same property which determines if the scale props are the same.

      Returns boolean

    • set same(same: boolean): void

      Sets the _same property which determines if the scale props are the same.

      Parameters

      • same: boolean

      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

    • Initializes the behaviour on a particle. Stores initial values for comparison and mutation in the applyBehaviour method.

      Parameters

      • particle: Particle

        the particle to initialize the behaviour on

      Returns void

    • Applies the behaviour to the particle. Mutates the particle's scale and its radius according to this scale.

      Parameters

      • particle: Particle

        the particle to apply the behaviour to

      • time: number

        engine time

      • Optionalindex: number

        the particle index

      Returns void

    • Resets the behaviour properties.

      Parameters

      • OptionalscaleA: number

        the starting scale value

      • OptionalscaleB: number

        the ending scale value

      • Optionallife: number

        the life of the behaviour

      • Optionaleasing: EasingFunction

        the easing equation to use for transforms

      Returns void

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

      Parameters

      • json: ScaleJSON

        JSON object containing the required constructor properties

      Returns Scale