Interface: base

syngen.prop.base

The most basic prop that exists on the soundstage. With its invent method, implementations can extend and create a hierarchy of prototypes with a variety of sounds and behaviors. Instances should be created and destroyed via syngen.props.

Source:

Extends

Members

(static) fadeInDuration :Number

Duration of fade in when instantiated.

Type:
  • Number
Source:

(static) fadeOutDuration :Number

Duration of fade out when destroyed.

Type:
  • Number
Source:

(static) name :String

Identifier of the prop type. Instances are discouraged from modifying this.

Type:
  • String
Source:

angularVelocity :syngen.utility.quaternion

Angular velocity, in radians per second.

Type:
Inherited From:
Source:

binaural :syngen.audio.binaural

Binaural processor for the prop.

Type:
Source:

distance :Number

The distance of the prop relative to the observer's coordinates.

Type:
  • Number
Source:

instantiated :Boolean

Indicates whether the prop has been instantiated.

Type:
  • Boolean
Source:

output :GainNode

Main output for audio synthesis and playback. This is not connected directly to the main audio destination; rather, it's routed through the binaural and reverb sends. On creation and destruction its gain is ramped to fade in and out. It's not recommended to modify its gain directly.

Type:
  • GainNode
Source:

quaternion :syngen.utility.quaternion

Orientation with respect to the coordinate system.

Type:
Inherited From:
Source:

radius :Number

Radius of the prop, in meters.

Type:
  • Number
Source:

relative :syngen.utility.vector3d

The coordinates of the prop relative to the observer's coordinates and orientation.

Type:
Source:

reverb :syngen.audio.mixer.send.reverb|Boolean

Reverb send for the prop. Implementations can disable reverb for certain prototypes by explicitly setting this to false.

Type:
Source:

token :String

Universally unique identifier provided during instantiation.

Type:
  • String
Source:

velocity :syngen.utility.vector3d

Lateral velocity, in meters per second.

Type:
Inherited From:
Source:

x :Number

Position along the x-axis, in meters.

Type:
  • Number
Inherited From:
Source:

y :Number

Position along the y-axis, in meters.

Type:
  • Number
Inherited From:
Source:

z :Number

Position along the z-axis, in meters.

Type:
  • Number
Inherited From:
Source:

Methods

(static) invent(definition) → {syngen.prop.base}

Invents a new prototype with definition that inherits the prototype from this prop.

Parameters:
Name Type Description
definition Object
Source:
Returns:
Type
syngen.prop.base

construct(optionsopt)

Initializes the prop with options and fades in its volume. Derivative props are discouraged from overriding this method. Instead they should define an onConstruct method.

Parameters:
Name Type Attributes Default Description
options Object <optional>
{}
Properties
Name Type Attributes Default Description
destination GainNode <optional>
syngen.audio.mixer.master.input()
radius Number <optional>

Defaults to the prototype's radius.

token String <optional>
syngen.utility.uuid()
x Number <optional>
0
y Number <optional>
0
z Number <optional>
0
Source:
See:

destroy()

Prepares the instance for garbage collection and fades out its volume. Derivative props are discouraged from overriding this method. Instead they should define an onDestroy method.

Source:
See:

euler() → {syngen.utility.euler}

Returns the orientation as an Euler angle.

Inherited From:
Source:
Returns:
Type
syngen.utility.euler

onConstruct()

Called after a prop is instantiated. Props should define this method to perform setup tasks after being constructed.

Source:
See:

onDestroy()

Called before a prop is destroyed. Props should define this method to perform tear tasks before being destroyed.

Source:
See:

onUpdate()

Called when a prop is updated. Props should define this method to perform tasks every frame.

Source:
See:

recalculate()

Recalculates the prop's relative coordinates and distance, binaural circuit, and reverb send.

Source:
See:

rect() → {Object}

Returns the rectangular prism surrounding the prop.

Source:
Returns:
Type
Object

resetPhysics()

Resets angular and lateral velocities to zero.

Inherited From:
Source:

update()

Called every frame. Derivative props are discouraged from overriding this method. Instead they should define an onUpdate method.

Source:
See:

updatePhysics(deltaopt)

Updates the coordinates and orientation due to angular and lateral velocities.

Parameters:
Name Type Attributes Default Description
delta Number <optional>
syngen.loop.delta()
Inherited From:
Source:

vector() → {syngen.utility.vector3d}

Returns the coordinates as a vector.

Inherited From:
Source:
Returns:
Type
syngen.utility.vector3d