three-nebula API
    Preparing search index...

    Class CrossZone

    Behaviour that allows for specific functions to be called on particles when they interact with a zone.

    Hierarchy (View Summary)

    Index
    • Constructs a CrossZone behaviour instance.

      Parameters

      • zone: Zone

        the zone used to apply to particles with this behaviour

      • OptionalcrossType: string

        enum of cross types, valid strings include 'dead', 'bound', 'cross'

      • Optionallife: number

        The life of the particle

      • Optionaleasing: EasingFunction

        The behaviour's decaying trend

      • OptionalisEnabled: boolean

        Determines if the behaviour will be applied or not

      Returns CrossZone

    _life: number
    age: number
    dead: boolean
    energy: number
    id: string
    isEnabled: boolean
    type: string
    zone: Zone
    • 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

    • 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

    • Applies the behaviour to the particle.

      Parameters

      • particle: Particle

        the particle to apply the behaviour to

      • time: number

        engine time

      • Optionalindex: number

        the particle index

      Returns void

      '../zone/Zone.js' crossing

    • Resets the behaviour properties.

      Parameters

      • zone: Zone

        the zone used to apply to particles with this behaviour

      • crossType: string = DEFAULT_CROSS_TYPE

        enum of cross types, valid strings include 'dead', 'bound', 'cross'

      • Optionallife: number

        The life of the particle

      • Optionaleasing: EasingFunction

        The behaviour's decaying trend

      Returns void