PointSource

PointSource

A helper class used by the Sight Layer to represent a source of vision or illumination.

Constructor

new PointSource(object)

Parameters:
Name Type Description
object PlaceableObject

The object responsible for the PointSource

Members

_animateSeed :number|null

An integer seed which de-synchronizes otherwise similar animations

Type:
  • number | null

_animateTime :number

Internal flag for animation throttling time

Type:
  • number

_hasColor :boolean

An internal flag for whether to render coloration for this source

Type:
  • boolean

_lightingVersion :number

A flag for the lighting channels version that this source is using.

Type:
  • number

_resetColorationUniforms :boolean

A flag for whether to re-initialize coloration shader uniforms the next time the light is rendered.

Type:
  • boolean

_resetIlluminationUniforms :boolean

A flag for whether to re-initialize illumination shader uniforms the next time the light is rendered.

Type:
  • boolean

active :boolean

A flag for whether this source is currently active (rendered) or not

Type:
  • boolean

coloration :PIXI.Container

This visible color container for this source

Type:
  • PIXI.Container

darkness :Object

The range of Scene darkness values for which this Source should be active

Type:
  • Object

GEOMETRY :PIXI.Geometry

The default Geometry stored in the GPU for all Point Source meshes.

Type:
  • PIXI.Geometry

illumination :PIXI.Container

The light or darkness container for this source

Type:
  • PIXI.Container

isDarkness :boolean

Internal flag for whether this is a darkness source

Type:
  • boolean

limited :boolean

Is the light source limited by an angle of emission?

Type:
  • boolean

object :PlaceableObject

The object responsible for the PointSource

Type:

radius :number

The maximum radius of emission for this source

Type:
  • number

sourceType :string

The type of source

Type:
  • string

Methods

animate(dt)

Animate the PointSource, if an animation is enabled and if it currently has rendered containers.

Parameters:
Name Type Description
dt number

Delta time

animatePulse(dt, speed, intensity)

A basic "pulse" animation which expands and contracts.

Parameters:
Name Type Description
dt number

Delta time

speed number

The animation speed, from 1 to 10

intensity number

The animation intensity, from 1 to 10

animateTime(dt, speed, intensity)

Emanate waves of light from the source origin point

Parameters:
Name Type Description
dt number

Delta time

speed number

The animation speed, from 1 to 10

intensity number

The animation intensity, from 1 to 10

animateTorch(dt, speed, intensity)

A torch animation where the luminosity and coloration decays each frame and is revitalized by flashes

Parameters:
Name Type Description
dt number

Delta time

speed number

The animation speed, from 1 to 10

intensity number

The animation intensity, from 1 to 10

drawColor() → {PIXI.Container}

Draw and return a container used to depict the visible color tint of the light source on the LightingLayer

Returns:

An updated color container for the source

Type
PIXI.Container

drawLight() → {PIXI.Container}

Draw the display of this source for the darkness/light container of the SightLayer.

Returns:

The rendered light container

Type
PIXI.Container

initialize(data) → {PointSource}

Initialize the source with provided object data.

Parameters:
Name Type Description
data object

Input data which configures the source.

Properties
Name Type Attributes Description
x number

The x-coordinate of the source location

y number

The y-coordinate of the source location

z number <optional>

An optional z-index sorting for the source

dim number

The allowed radius of dim vision or illumination

bright number

The allowed radius of bright vision or illumination

angle number

The angle of emission for this point source

rotation number

The angle of rotation for this point source

color number

A tint color for the emitted light, if any

alpha number

An opacity for the emitted light, if any

darkness object

A darkness range (min and max) for which the source should be active

type string

The source type from CONST.SOURCE_TYPES

animation object

An animation configuration for the source

seed number

An integer seed to synchronize (or de-synchronize) animations

Returns:

A reference to the initialized source

Type
PointSource