Drag[en]gine Script Module DragonScript  1.23
Dragengine.Scenery.ECBehaviorHearSounds Class Reference

Behavior element behavior adding hearing sounds support. More...

Inheritance diagram for Dragengine.Scenery.ECBehaviorHearSounds:
Dragengine.Scenery.DefaultECBehavior Dragengine.Scenery.ECBehavior Dragengine.Scenery.BehaviorCompatiblePersistency

Classes

class  BlockListenerFactory
 Factory creating listeners using block. More...
 
class  DefaultListener
 Default implementation of behavior instance listener. More...
 
class  Instance
 Behavior instance. More...
 
interface  Listener
 Listener for behavior instance events. More...
 
interface  ListenerFactory
 Factory creating listeners. More...
 

Additional Inherited Members

- Public Member Functions inherited from Dragengine.Scenery.DefaultECBehavior
void assignInstanceIndex (int instanceIndex)
 Assign instance index. More...
 
void dispose ()
 Dispose of behavior. More...
 
String getBehaviorID ()
 Unique identifier of behavior. More...
 
String getID ()
 Identifier. More...
 
int getInstanceIndex ()
 Instance index. More...
 
void loadSupportedData (String identifier, PersistencyEnvironment env, FileReader reader, ECBehaviorInstance instance)
 Load instance data of another behavior. More...
 
bool supportsBehaviorID (String identifier)
 Behavior supports loading instance data of another behavior. More...
 
- Public Member Functions inherited from Dragengine.Scenery.ECBehavior
ECBehaviorInstance createInstance (BehaviorElement element)
 Create Behavior instance. More...
 
- Protected Member Functions inherited from Dragengine.Scenery.DefaultECBehavior
DefaultECBehavior new (BehaviorElementClass eclass)
 Create default composeable behavior with empty identifier. More...
 
DefaultECBehavior new (BehaviorElementClass eclass, String id)
 Create default composeable behavior. More...
 
void setBehaviorID (String identifier)
 Set behavior identifier. More...
 
void useClassNameAsBehaviorID ()
 Set behavior identifier to "<class-name>:<identifier>". More...
 
void useFullyQualifiedClassNameAsBehaviorID ()
 Set behavior identifier to "<fully-qualified-class-name>:<identifier>". More...
 

Detailed Description

Behavior element behavior adding hearing sounds support.

Uses a SoundLevelMeter resources to hear what sounds are playing in the audible range of the element.

SoundLevelMeter resources take sound properties of the environment into account like occlusion and how sound propagates through the world geometry. This allows game entities to hear the world similar to how a player hears the world what goes for sound volumes.

The SoundLevelMeter resource can be queried for the speakers currently in audible range and the volume they exhibit. Advanced effects audible to players like frequency band specific gains or special effects are disregarded. Furthermore speakers entering and leaving trigger a notification allowing elements to track elements of interest.

If the ECBehaviorCollider behavior is present in the behavior element the SoundLevelMeter is attached to the collider.

The behavior retrieves the owner of Speakers inside the audible range. If these owners are elements they are stored in a list of elements heared by the owner element. This list is updated when elements enter or leave the audible range. The volume of an element can be queried if required but is not stored.

The owner behavior element as well as other ECBehavior subclasses can add a listener to be notified if elements enter and exit the audible range.

This element behavior can be present only once in a BehaviorElement. Trying to add more than one instance results in an exception thrown.

Element class properties have the prefix "hearSound.".

This behavior does require the element class to be persistable (setPersistable).


The documentation for this class was generated from the following file: