SoundComponent

SoundComponent

Component that adds sound to an entity.

Constructor

new SoundComponent()

Members

sounds :Array.<Sound>

Current sounds in the entity. Add a sound using SoundComponent#addSound.

Methods

addSound(sound)

Add a sound to the component

Parameters:
Name Type Description
sound Sound

getSoundById(id) → {Sound}

Get a component's sound by id

Parameters:
Name Type Description
id string

process(settings, mvMat)

Updates position and orientation of component and thereby all connected sounds.
Since all sounds in the engine are relative to the current camera, the model view matrix needs to be passed to this method.

Parameters:
Name Type Description
settings Object

See SoundSystem

mvMat Matrix4

The model view matrix from the current camera, or falsy if the component is attached to the camera.

removeSound(sound)

Remove sound from component

Parameters:
Name Type Description
sound Sound