Options
All
  • Public
  • Public/Protected
  • All
Menu

A specialized subclass of the PointSource abstraction which is used to control the rendering of vision sources.

property

{VisionSourceData} data

Hierarchy

Index

Constructors

Properties

data: PointSourceData = ...

The object of data which configures how the source is rendered

visionMode: VisionMode = null

The vision mode linked to this VisionSource

_visionModeActivated: boolean = false

The vision mode activation flag for handlers

internal

The unconstrained LOS polygon.

The animation configuration applied to this source

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

layers: { background: RenderedPointSourceLayer; coloration: RenderedPointSourceLayer; illumination: RenderedPointSourceLayer } = ...

Track the status of rendering layers

Type declaration

colorRGB: [number, number, number] = null

The color of the source as a RGB vector.

object: any
_flags: Object = {}

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

#geometry: any = null

PIXI Geometry generated to draw meshes.

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

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

_initializeShaderKeys: string[] = ...
override
_refreshUniformsKeys: string[] = ...
override
EDGE_OFFSET: number = -2

The offset in pixels applied to create soft edges.

Accessors

  • get preferred(): boolean
  • If this vision source background is rendered into the lighting container.

    Returns boolean

  • get isAnimated(): boolean
  • override

    Returns boolean

  • A convenience accessor to the background layer mesh.

    Returns PointSourceMesh

  • A convenience accessor to the coloration layer mesh.

    Returns PointSourceMesh

  • A convenience accessor to the illumination layer mesh.

    Returns PointSourceMesh

  • get hasActiveLayer(): boolean
  • Has the rendered source at least one active layer?

    Returns boolean

  • get isPreview(): boolean
  • Is this RenderedPointSource a temporary preview?

    Returns boolean

  • 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(data: any): void
  • _configure(changes: any): void
  • _configureLayer(layer: any, layerId: any): void
  • _configureShaders(): { background: any; coloration: any; illumination: any }
  • drawMeshes(): { background: Mesh; coloration: Mesh; illumination: Mesh }
  • Render the containers used to represent this light source within the LightingLayer

    Returns { background: Mesh; coloration: Mesh; illumination: Mesh }

    • background: Mesh
    • coloration: Mesh
    • illumination: Mesh
  • _refresh(): void
  • _isActive(): boolean
  • _destroy(): void
  • animate(dt: number): any
  • Animate the PointSource, if an animation is enabled and if it currently has rendered containers.

    Parameters

    • dt: number

      Delta time.

    Returns any

  • animateTime(dt: number, [options]?: { speed: number; intensity: number; reverse: boolean }): void
  • Generic time-based animation used for Rendered Point Sources.

    Parameters

    • dt: number

      Delta time.

    • [options]: { speed: number; intensity: number; reverse: boolean } = {}

      Options which affect the time animation

      • speed: number
      • intensity: number
      • reverse: boolean

    Returns void

  • Initialize and configure the PointSource using provided data.

    Parameters

    • data: any = {}

      Provided data for configuration

    Returns PointSource

    The configured source

  • refresh(): void
  • destroy(): void
  • _initializeVisionMode(): void
  • Responsible for assigning the Vision Mode and handling exceptions based on vision special status.

    Returns void

  • Create a restricted FOV polygon by limiting the radius of the unrestricted LOS polygon.

    Returns PointSourcePolygon

  • _updateColorationUniforms(): void
  • _updateIlluminationUniforms(): void
  • _configureSoftEdges(): void
  • _configureColorAttributes(color: number): void
  • Configure the derived color attributes and associated flag.

    Parameters

    • color: number

      The color to configure (usually a color coming for the rendered point source data) or null if no color is configured for this rendered source.

    Returns void

  • _initializeBlending(): void
  • _updateBackgroundUniforms(): void
  • Update shader uniforms shared by all shader types

    Parameters

    Returns void

  • Update layer uniforms according to vision mode uniforms, if any.

    Parameters

    Returns void

  • #initializeShaders(): void
  • #initializeMeshes(): boolean
  • Create or update the source geometry and create meshes if necessary

    Returns boolean

    True if the shaders need to be initialized.

  • #createMeshes(): void
  • #updateGeometry(): void
  • Create the geometry for the source shape that is used in shaders and compute its bounds for culling purpose. Triangulate the form and create buffers.

    Returns void

  • #drawMesh(layerId: string): any
  • Create a Mesh for the background component of this source which will be added to CanvasBackgroundEffects.

    Parameters

    • layerId: string

      The layer key in layers to draw

    Returns any

    The drawn mesh for this layer, or null if no mesh is required

  • #updateUniforms(): void
  • #updateVisibleLayers(): void