The IListener graph node interface. More...
#include "murl_graph_i_listener.h"
Public Member Functions | |
virtual INode * | GetNodeInterface ()=0 |
Get the mutable INode interface. More... | |
virtual const INode * | GetNodeInterface () const =0 |
Get the constant INode interface. More... | |
virtual ISubject * | GetSubjectInterface ()=0 |
Get the mutable ISubject interface. More... | |
virtual const ISubject * | GetSubjectInterface () const =0 |
Get the constant ISubject interface. More... | |
virtual IViewNodeTarget * | GetViewNodeTarget ()=0 |
Get the mutable IViewNodeTarget container. More... | |
virtual const IViewNodeTarget * | GetViewNodeTarget () const =0 |
Get the constant IViewNodeTarget container. More... | |
virtual Bool | SetVolume (Real volume)=0 |
Set the listener's volume (gain). More... | |
virtual Real | GetVolume () const =0 |
Get the listener's volume (gain). More... | |
virtual Bool | SetMaxDistance (Real maxDistance)=0 |
Set the maximum hearing distance. More... | |
virtual Real | GetMaxDistance () const =0 |
Get the maximum hearing distance. More... | |
virtual Bool | SetDistanceModel (IEnums::DistanceModel distanceModel)=0 |
Set the listener's distance model used for attenuation calculation. More... | |
virtual IEnums::DistanceModel | GetDistanceModel () const =0 |
Get the listener's distance model used for attenuation calculation. More... | |
virtual UInt32 | GetNumberOfStages () const =0 |
Get the listener's number of stages. More... | |
virtual Audio::IListener * | GetAudioListenerObject (UInt32 stage) const =0 |
Get the listener's internal audio renderer object. More... | |
Public Member Functions inherited from Murl::Graph::IStateSlot | |
virtual Bool | SetSlot (SInt32 slot)=0 |
Set the slot index to use. More... | |
virtual SInt32 | GetSlot () const =0 |
Get the slot index to use. More... | |
Detailed Description
The IListener graph node interface.
A listener represents a node positioned in world space that is "listening" to any sound sources (e.g. IAudioSequence nodes) within its hearing range. All captured sources are attenuated according to their distance and given parameters, and mixed together afterwards.
See Output-States, Slots und Units for an overview of state handling during scene graph traversal.
See Graph::IListenerTransform for setting a listener's position and orientation. See Graph::IListenerState for activating a listener for rendering.
Gain calculation formula:
REFERENCE_DISTANCE = referenceDistance attribute from IPlayable
ROLLOFF_FACTOR = rolloffFactor attribute from IPlayable
MAX_DISTANCE = maxDistance attribute from IPlayable
- distanceModel="INVERSE"
gain = REFERENCE_DISTANCE / (REFERENCE_DISTANCE + ROLLOFF_FACTOR * (distance – REFERENCE_DISTANCE)) - distanceModel="INVERSE_CLAMPED"
distance = max(distance, REFERENCE_DISTANCE)
distance = min(distance, MAX_DISTANCE)
gain = REFERENCE_DISTANCE / (REFERENCE_DISTANCE + ROLLOFF_FACTOR * (distance – REFERENCE_DISTANCE)) - distanceModel="LINEAR"
distance = min(distance, MAX_DISTANCE) // avoid negative gain
gain = (1 – ROLLOFF_FACTOR * (distance – REFERENCE_DISTANCE) / (MAX_DISTANCE – REFERENCE_DISTANCE)) - distanceModel="LINEAR_CLAMPED"
distance = max(distance, REFERENCE_DISTANCE)
distance = min(distance, MAX_DISTANCE)
gain = (1 – ROLLOFF_FACTOR * (distance – REFERENCE_DISTANCE) / (MAX_DISTANCE – REFERENCE_DISTANCE)) - distanceModel="EXPONENT"
gain = (distance / REFERENCE_DISTANCE) ^ (- ROLLOFF_FACTOR) - distanceModel="EXPONENT_CLAMPED"
distance = max(distance, REFERENCE_DISTANCE)
distance = min(distance, MAX_DISTANCE)
gain = (distance / REFERENCE_DISTANCE) ^ (- ROLLOFF_FACTOR)
Member Function Documentation
◆ GetNodeInterface() [1/2]
|
pure virtual |
◆ GetNodeInterface() [2/2]
|
pure virtual |
◆ GetSubjectInterface() [1/2]
|
pure virtual |
◆ GetSubjectInterface() [2/2]
|
pure virtual |
◆ GetViewNodeTarget() [1/2]
|
pure virtual |
Get the mutable IViewNodeTarget container.
This method returns a mutable pointer to the node's IViewNodeTarget container, which allows to set or query the view object the listener is attached to.
- Returns
- The mutable IViewNodeTarget container, or null if not available
◆ GetViewNodeTarget() [2/2]
|
pure virtual |
Get the constant IViewNodeTarget container.
This method returns a constant pointer to the node's IViewNodeTarget container, which allows to query the view object the listener is attached to.
- Returns
- The constant IViewNodeTarget container, or null if not available
◆ SetVolume()
Set the listener's volume (gain).
- Parameters
-
volume The overall volume.
- Returns
- true if successful.
◆ GetVolume()
|
pure virtual |
Get the listener's volume (gain).
- Returns
- The overall volume.
◆ SetMaxDistance()
Set the maximum hearing distance.
- Parameters
-
maxDistance The maximum distance.
- Returns
- true if successful.
◆ GetMaxDistance()
|
pure virtual |
Get the maximum hearing distance.
- Returns
- The maximum distance.
◆ SetDistanceModel()
|
pure virtual |
Set the listener's distance model used for attenuation calculation.
- Parameters
-
distanceModel The distance model to use.
- Returns
- true if successful.
◆ GetDistanceModel()
|
pure virtual |
Get the listener's distance model used for attenuation calculation.
- Returns
- The distance model used.
◆ GetNumberOfStages()
|
pure virtual |
Get the listener's number of stages.
- Returns
- The number of stages.
◆ GetAudioListenerObject()
|
pure virtual |
Get the listener's internal audio renderer object.
- Parameters
-
stage The stage to query.
- Returns
- The audio renderer object.
The documentation for this interface was generated from the following file:
- murl_graph_i_listener.h