Room¶
Represents a physical space where sound waves can propagate.
Detailed Description¶
Any sound source within the room will be affected by the room's properties, and got applied early reflections and reverberation effects.
The Room class is a lightweight wrapper around the internal RoomInternalState class.
Public Functions¶
| Type | Name |
|---|---|
| void | Clear () Uninitializes this room. |
| AmVector3 | GetDimensions () const Gets the dimensions of the room in meters. |
| AmVector3 | GetDirection () const Gets the direction vector of this room. |
| AmReal32 | GetGain () const Gets the room effects gain. |
| AmRoomID | GetId () const Returns the unique ID of this room. |
| const AmVector3 & | GetLocation () const Gets the current location of this room. |
| const Orientation & | GetOrientation () const Gets the current orientation of this room. |
| const BoxShape & | GetShape () const Gets the shape representing this room. |
| RoomInternalState * | GetState () const Gets the internal state of the room. |
| AmReal32 | GetSurfaceArea (eRoomWall wall) const Gets the surface area for a specific wall of this room. |
| AmVector3 | GetUp () const Gets the up vector of this room. |
| AmReal32 | GetVolume () const Gets the volume of the room in m3. |
| const RoomWallMaterial & | GetWallMaterial (eRoomWall wall) const Gets the material for a specific wall of this room. |
| Room () Creates an uninitialized room. | |
| Room (RoomInternalState * state) Creates a wrapper instance over the provided state. | |
| void | SetAllWallMaterials (const RoomWallMaterial & material) const Sets the material for all walls of this room. |
| void | SetDimensions (AmVector3 dimensions) const Sets the shape's dimensions of this room. |
| void | SetGain (AmReal32 gain) const Sets the room effects gain. |
| void | SetLocation (const AmVector3 & location) const Sets the location room. |
| void | SetOrientation (const Orientation & orientation) const Sets the orientation of this room. |
| void | SetShape (const BoxShape & shape) const Sets the shape representing this room. |
| void | SetWallMaterial (eRoomWall wall, const RoomWallMaterial & material) const Sets the material for a specific wall of this room. |
| void | SetWallMaterials (const RoomWallMaterial & leftWallMaterial, const RoomWallMaterial & rightWallMaterial, const RoomWallMaterial & floorMaterial, const RoomWallMaterial & ceilingMaterial, const RoomWallMaterial & frontWallMaterial, const RoomWallMaterial & backWallMaterial) const Sets the material for each wall of this room. |
| void | Update () const Updates the state of this room. |
| bool | Valid () const Checks whether this room has been initialized. |
Public Functions Documentation¶
Clear
Uninitializes this room.
Note:
This doesn't destroy the internal state it references, it just removes this reference to it.
Note:
To completely destroy the room, use the RemoveRoom() method of the Engine instance.
GetDimensions
Gets the dimensions of the room in meters.
Returns:
The dimensions of the room's shape.
GetDirection
Gets the direction vector of this room.
Returns:
The direction (forward) vector.
GetGain
Gets the room effects gain.
Returns:
The room effects gain.
GetId
Returns the unique ID of this room.
Returns:
The room's unique ID.
GetLocation
Gets the current location of this room.
Returns:
The current location of this room.
GetOrientation
Gets the current orientation of this room.
Returns:
The current orientation of this room.
GetShape
Gets the shape representing this room.
Returns:
The room shape.
GetState
Gets the internal state of the room.
Returns:
The room's internal state.
Warning:
This method is for internal usage only.
GetSurfaceArea
Gets the surface area for a specific wall of this room.
Parameters:
-
wallThe wall to get the surface area for.
Returns:
The surface area of the specified wall.
GetUp
Gets the up vector of this room.
Returns:
The up vector.
GetVolume
Gets the volume of the room in m3.
Returns:
The volume of the room's shape.
GetWallMaterial
Gets the material for a specific wall of this room.
Parameters:
-
wallThe wall to get the material for.
Returns:
The material of the specified wall.
Room[1/2]
Creates an uninitialized room.
Note:
An uninitialized room doesn't affect sound sources.
Note:
To create an initialized room, use the AddRoom() method of the Engine instance.
Room[2/2]
Creates a wrapper instance over the provided state.
Parameters:
-
stateThe internal state to wrap.
Warning:
This constructor is for internal usage only.
SetAllWallMaterials
Sets the material for all walls of this room.
Parameters:
-
materialThe new material.
SetDimensions
Sets the shape's dimensions of this room.
Parameters:
-
dimensionsThe new dimensions.
SetGain
Sets the room effects gain.
Parameters:
-
gainThe gain applied to early reflections and reverberations effects.
SetLocation
Sets the location room.
Parameters:
-
locationThe new location.
SetOrientation
Sets the orientation of this room.
Parameters:
-
orientationThe new orientation.
SetShape
Sets the shape representing this room.
Parameters:
-
shapeThe new shape.
SetWallMaterial
Sets the material for a specific wall of this room.
Parameters:
-
wallThe wall to set the material for. -
materialThe new material.
SetWallMaterials
Sets the material for each wall of this room.
void Amplitude::Room::SetWallMaterials (
const RoomWallMaterial & leftWallMaterial,
const RoomWallMaterial & rightWallMaterial,
const RoomWallMaterial & floorMaterial,
const RoomWallMaterial & ceilingMaterial,
const RoomWallMaterial & frontWallMaterial,
const RoomWallMaterial & backWallMaterial
) const
Parameters:
-
leftWallMaterialThe material for the left wall. -
rightWallMaterialThe material for the right wall. -
floorMaterialThe material for the floor. -
ceilingMaterialThe material for the ceiling. -
frontWallMaterialThe material for the front wall. -
backWallMaterialThe material for the back wall.
Update
Updates the state of this room.
The Engine calls this method automatically on each frame to update the internal state of the room.
Warning:
This method is for internal usage only.
Valid
Checks whether this room has been initialized.
Returns:
true if this room has been initialized with a valid state, false otherwise.
The documentation for this class was generated from the following file: include/SparkyStudios/Audio/Amplitude/Core/Room.h