A specialized subclass of RenderedEffectSource which represents a source of point-based vision.

Hierarchy

  • any
    • PointVisionSource

Constructors

  • An effect source is constructed by providing configuration options.

    Parameters

    Returns PointVisionSource

Properties

visionMode: any = null

The vision mode linked to this VisionSource

_visionModeActivated: boolean = false

The vision mode activation flag for handlers

los: PointSourcePolygon

The unconstrained LOS polygon.

light: PointSourcePolygon

The polygon of light perception.

blinded: Record<string, boolean> = {}

Records of blinding strings with a boolean value. By default, if any of this record is true, the source is blinded.

visionModeOverrides: object = {}

Data overrides that could happen with blindness vision mode.

sourceType: string = "sight"

Inherit Doc

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

Inherit Doc

effectsCollection: string = "visionSources"
defaultData: any = ...

Inherit Doc

_dimLightingLevel: number = LIGHTING_LEVELS.DIM

The corresponding lighting levels for dim light.

_brightLightingLevel: string = LIGHTING_LEVELS.BRIGHT

The corresponding lighting levels for bright light.

Accessors

  • get fov(): any
  • An alias for the shape of the vision source.

    Returns any

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

    Returns boolean

  • get isAnimated(): boolean
  • Is the rendered source animated?

    Returns boolean

  • get lightRadius(): number
  • Light perception radius of this vision source, taking into account if the source is blinded.

    Returns number

  • get radius(): any
  • Returns any

  • get isBlinded(): boolean
  • Is this source temporarily blinded?

    Returns boolean

  • get #hasBlindedVisionMode(): boolean
  • To know if blindness vision mode is configured for this source. Note: Convenient method used to avoid calling this.blinded which is costly.

    Returns boolean

  • get _layers(): object
  • Returns object

Methods

  • Parameters

    • data: any

    Returns void

    Inherit Doc

  • Returns void

    Inherit Doc

  • Parameters

    • changes: any

    Returns void

    Inherit Doc

  • Parameters

    • layer: any
    • layerId: any

    Returns void

  • Returns any

    Inherit Doc

  • Returns {}

    • Returns void

      Inherit Doc

    • Returns void

      Inherit Doc

    • Returns void

      Inherit Doc

    • Parameters

      • shader: any

      Returns void

      Inherit Doc

    • Protected

      Responsible for assigning the Vision Mode and calling the activation and deactivation handlers.

      Returns void

    • Protected

      Creates the polygon that represents light perception. If the light perception radius is unconstrained, no new polygon instance is created; instead the LOS polygon of this vision source is returned.

      Returns PointSourcePolygon

      The new polygon or this.los.

    • Protected

      Create a restricted FOV polygon by limiting the radius of the unrestricted LOS polygon. If the vision radius is unconstrained, no new polygon instance is created; instead the LOS polygon of this vision source is returned.

      Returns PointSourcePolygon

      The new polygon or this.los.

    • Protected

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

      Parameters

      • shader: AdaptiveVisionShader

        The shader being updated.

      • vmUniforms: any[]

        The targeted layer.

      Returns void

    • Update darkness blinding according to darkness sources collection.

      Returns void

    • Create a constrained polygon by limiting the radius of the unrestricted LOS polygon. If the radius is unconstrained, no new polygon instance is created; instead the LOS polygon of this vision source is returned.

      Parameters

      • radius: number

        The radius to constraint to.

      Returns PointSourcePolygon

      The new polygon or this.los.

    • Get corrected level according to level and active vision mode data.

      Parameters

      • level: LIGHTING_LEVELS

      Returns number

      The corrected level.

    • Get corrected color according to level, dim color, bright color and background color.

      Parameters

      • level: LIGHTING_LEVELS
      • colorDim: typeof Color
      • colorBright: typeof Color
      • Optional colorBackground: typeof Color

      Returns typeof Color