Options
All
  • Public
  • Public/Protected
  • All
Menu

An abstract base class which defines a framework for effect sources which originate radially from a specific point. This abstraction is used by the LightSource, VisionSource, SoundSource, and MovementSource subclasses.

example

A standard PointSource lifecycle:

const source = new PointSource({object}); // Create the point source
source.initialize(data); // Configure the point source with new data
source.refresh(); // Refresh the point source
source.destroy(); // Destroy the point source
param [options]
param [options.object]

Some other object which is responsible for this source

abstract

Hierarchy

Index

Constructors

Properties

object: any
data: PointSourceData = {}

The data of this source.

The polygonal shape of the point source, generated from its origin, radius, and other data.

_flags: Object = {}

A collection of boolean flags which control rendering and refresh behavior for the source.

#updateId: number = 0
#active: boolean = false
#initialized: boolean = false
sourceType: string

The type of source represented by this data structure. Each subclass must implement this attribute.

Accessors

  • get updateId(): number
  • Returns the update ID associated with this point source. The update ID is increased whenever the source is initialized.

    Returns number

  • get active(): boolean
  • Is this point source currently active? Returns false if the source is disabled, temporarily suppressed, or not initialized.

    Returns boolean

  • get disabled(): boolean
  • Is this source currently disabled? Returns false if the source hasn't been initialized yet.

    Returns boolean

  • get initialized(): boolean
  • Has this point source been initialized?

    Returns boolean

  • get x(): number
  • The x-coordinate of the point source origin.

    Returns number

  • get y(): number
  • The y-coordinate of the point source origin.

    Returns number

  • get elevation(): number
  • The elevation bound to this source.

    Returns number

  • get radius(): number
  • A convenience reference to the radius of the source.

    Returns number

Methods

  • Initialize and configure the PointSource using provided data.

    Parameters

    • data: any = {}

      Provided data for configuration

    Returns PointSource

    The configured source

  • refresh(): void
  • Refresh the state and uniforms of the PointSource.

    Returns void

  • destroy(): void
  • Steps that must be performed when the base source is destroyed.

    Returns void

  • _initialize(data: any): void
  • Subclass specific data initialization steps. This method is responsible for populating the instance data object.

    Parameters

    • data: any

      Provided data for configuration

    Returns void

  • _configure(changes?: any): void
  • Subclass specific configuration steps. Occurs after data initialization and shape computation.

    Parameters

    • changes: any = {}

      The fields of data which changed during initialization

    Returns void

  • _isActive(): boolean
  • Test whether this source should be active under current conditions?

    Returns boolean

  • _refresh(): void
  • Subclass-specific refresh steps.

    abstract

    Returns void

  • _destroy(): void
  • Subclass specific destruction steps.

    abstract

    Returns void

  • Create the polygon shape for this source using configured data.

    Returns PointSourcePolygon