Environment¶
An Environment is a zone where every spatialized audio playing inside him got applied a specific effect.
Detailed Description¶
The Environment class is a lightweight reference to an EnvironmentInternalState object which is managed internally by the Engine.
Public Functions¶
| Type | Name |
|---|---|
| void | Clear () Uninitializes this environment. |
| Environment () Creates an uninitialized environment. | |
| Environment (EnvironmentInternalState * state) Creates a wrapper instance over the provided state. | |
| AmVector3 | GetDirection () const Gets the direction vector of the environment. |
| const Effect * | GetEffect () const Gets the effect linked to this environment. |
| AmReal32 | GetFactor (const AmVector3 & location) const Gets the environment factor for the given location. |
| AmReal32 | GetFactor (const Entity & entity) const Gets the environment factor for the given entity. |
| AmEnvironmentID | GetId () const Returns the unique ID of this environment. |
| const AmVector3 & | GetLocation () const Gets the current location of this environment. |
| const Orientation & | GetOrientation () const Gets the current orientation of this environment. |
| EnvironmentInternalState * | GetState () const Returns the internal state of this environment. |
| AmVector3 | GetUp () const Gets the up vector of the environment. |
| std::shared_ptr< Zone > | GetZone () const Gets the zone linked to this environment. |
| void | SetEffect (AmEffectID effect) const Sets the effect applied in the environment. |
| void | SetEffect (const AmString & effect) const Sets the effect applied in the environment. |
| void | SetEffect (const Effect * effect) const Sets the effect applied in the environment. |
| void | SetLocation (const AmVector3 & location) const Sets the location of this environment. |
| void | SetOrientation (const Orientation & orientation) const Sets the orientation of this environment. |
| void | SetZone (std::shared_ptr< Zone > zone) const Sets the zone for this environment. |
| void | Update () const Updates the state of this environment. |
| bool | Valid () const Checks whether this environment has been initialized. |
Public Functions Documentation¶
Clear
Uninitializes this environment.
Note:
This does not destroy the internal state it references, it just removes this reference to it.
To completely destroy the environment, use the RemoveEnvironment() method of the Engine instance.
Environment[1/2]
Creates an uninitialized environment.
An uninitialized environment cannot provide location and orientation information, and therefore cannot play sounds.
To create an initialized environment, use the AddEnvironment() method of the Engine instance.
Environment[2/2]
Creates a wrapper instance over the provided state.
Parameters:
-
stateThe internal state to wrap.
Warning:
This constructor is for internal usage only.
GetDirection
Gets the direction vector of the environment.
Returns:
The direction vector.
GetFactor[1/2]
Gets the environment factor for the given location.
Parameters:
-
locationThe location for which compute the environment factor.
Returns:
The environment factor.
GetFactor[2/2]
Gets the environment factor for the given entity.
Parameters:
-
entityThe entity for which compute the environment factor.
Returns:
The environment factor.
GetId
Returns the unique ID of this environment.
Returns:
The environment's unique ID.
GetLocation
Gets the current location of this environment.
Returns:
The current location of this environment.
GetOrientation
Gets the current orientation of this environment.
Returns:
The current orientation of this environment.
GetState
Returns the internal state of this environment.
Returns:
The environment internal state.
Warning:
This method is for internal usage only.
GetUp
Gets the up vector of the environment.
Returns:
The up vector.
SetEffect[1/3]
Sets the effect applied in the environment.
Parameters:
-
effectThe ID of the effect to apply in the environment.
See also: Effect
SetEffect[2/3]
Sets the effect applied in the environment.
Parameters:
-
effectThe name of the effect to apply in the environment.
See also: Effect
SetEffect[3/3]
Sets the effect applied in the environment.
Parameters:
-
effectThe effect to apply in the environment.
See also: Effect
SetLocation
Sets the location of this environment.
Parameters:
-
locationThe new location.
SetOrientation
Sets the orientation of this environment.
Parameters:
-
orientationThe new orientation.
Update
Updates the state of this environment.
The Engine calls this method automatically on each frame to update the internal state of the environment.
Warning:
This method is for internal usage only.
Valid
Checks whether this environment has been initialized.
Returns:
true if this environment is initialized, false otherwise.
The documentation for this class was generated from the following file: include/SparkyStudios/Audio/Amplitude/Core/Environment.h