SoundSource

SoundSource

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

Constructor

new SoundSource(object)

Parameters:
Name Type Description
object AmbientSound

The AmbientSound object that generates this sound source

Extends

Members

(protected) _flags :Object.<string, boolean>

Inherited From:

Boolean flags which control whether certain behaviors of the source must be enforced

Type:
  • Object.<string, boolean>

active :boolean

Inherited From:

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

Type:
  • boolean

data :SoundSourceData

Overrides:

The object of data which configures how the source is rendered

Type:

GEOMETRY :PIXI.Geometry

Inherited From:

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

Type:
  • PIXI.Geometry

limited :boolean

Inherited From:

Is the angle of emission for this source limited?

Type:
  • boolean

los :PointSourcePolygon

Overrides:

The restricted line-of-sight polygon that is generated by the origin and radius of this source.

Type:

losMask :PIXI.Graphics

Inherited From:

A Graphics object with pre-computed geometry used for masking based on line-of-sight.

Type:
  • PIXI.Graphics

object :PlaceableObject

Inherited From:

The object responsible for this source.

Type:

radius :number

Inherited From:

The maximum radius of emission for this source

Type:
  • number

sourceType :string

Overrides:

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

Type:
  • string

x :number

Inherited From:

The x-coordinate of the point source origin.

Type:
  • number

y :number

Inherited From:

The y-coordinate of the point source origin.

Type:
  • number

Methods

(protected) _createMesh(shaderCls) → {PIXI.Mesh}

Inherited From:

Create a new Mesh for this source using a provided shader class

Parameters:
Name Type Description
shaderCls function

The subclass of AdaptiveLightingShader being used for this Mesh

Returns:

The created Mesh

Type
PIXI.Mesh

(protected) _drawRenderTextureContainer() → {PIXI.Container}

Inherited From:

Create a container that should be rendered to the fov texture for this source

Returns:

The drawn container for the render texture

Type
PIXI.Container

(protected) _renderTexture() → {PIXI.RenderTexture}

Inherited From:

Render this source to a texture which can be used for masking and blurring.

Returns:
Type
PIXI.RenderTexture

(protected) _updateMesh(mesh) → {PIXI.Mesh}

Inherited From:

Update the position and size of the mesh each time it is drawn.

Parameters:
Name Type Description
mesh PIXI.Mesh

The Mesh being updated

Returns:

The updated Mesh

Type
PIXI.Mesh

containsPoint(point) → {boolean}

Inherited From:

A point is contained with the area of the source if it is within both the FOV circle as well as the LOS polygon.

Parameters:
Name Type Description
point Point

The point to test

Returns:

Is the point contained

Type
boolean

destroy()

Inherited From:

Steps that must be performed when the base source is destroyed.

getPowerOf2Size() → {number}

Inherited From:

Get power of 2 size pertaining to base-source radius and performance modes

Returns:

The computed power of 2 size

Type
number

initialize(data) → {SoundSource}

Overrides:
  • PointSource#initialize

Initialize the source with provided object data.

Parameters:
Name Type Description
data object

Initial data provided to the point source

Returns:

A reference to the initialized source

Type
SoundSource