Skip to content

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.

void Amplitude::Room::Clear () 

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.

amEngine->RemoveRoom(1234); // You should provide the room ID
GetDimensions

Gets the dimensions of the room in meters.

AmVector3 Amplitude::Room::GetDimensions () const

Returns:

The dimensions of the room's shape.

GetDirection

Gets the direction vector of this room.

AmVector3 Amplitude::Room::GetDirection () const

Returns:

The direction (forward) vector.

GetGain

Gets the room effects gain.

AmReal32 Amplitude::Room::GetGain () const

Returns:

The room effects gain.

GetId

Returns the unique ID of this room.

AmRoomID Amplitude::Room::GetId () const

Returns:

The room's unique ID.

GetLocation

Gets the current location of this room.

const AmVector3 & Amplitude::Room::GetLocation () const

Returns:

The current location of this room.

GetOrientation

Gets the current orientation of this room.

const Orientation & Amplitude::Room::GetOrientation () const

Returns:

The current orientation of this room.

GetShape

Gets the shape representing this room.

const BoxShape & Amplitude::Room::GetShape () const

Returns:

The room shape.

GetState

Gets the internal state of the room.

RoomInternalState * Amplitude::Room::GetState () const

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.

AmReal32 Amplitude::Room::GetSurfaceArea (
    eRoomWall wall
) const

Parameters:

  • wall The wall to get the surface area for.

Returns:

The surface area of the specified wall.

GetUp

Gets the up vector of this room.

AmVector3 Amplitude::Room::GetUp () const

Returns:

The up vector.

GetVolume

Gets the volume of the room in m3.

AmReal32 Amplitude::Room::GetVolume () const

Returns:

The volume of the room's shape.

GetWallMaterial

Gets the material for a specific wall of this room.

const RoomWallMaterial & Amplitude::Room::GetWallMaterial (
    eRoomWall wall
) const

Parameters:

  • wall The wall to get the material for.

Returns:

The material of the specified wall.

Room[1/2]

Creates an uninitialized room.

Amplitude::Room::Room () 

Note:

An uninitialized room doesn't affect sound sources.

Note:

To create an initialized room, use the AddRoom() method of the Engine instance.

amEngine->AddRoom(1234); // You should provide a unique ID
Room[2/2]

Creates a wrapper instance over the provided state.

explicit Amplitude::Room::Room (
    RoomInternalState * state
) 

Parameters:

  • state The internal state to wrap.

Warning:

This constructor is for internal usage only.

SetAllWallMaterials

Sets the material for all walls of this room.

void Amplitude::Room::SetAllWallMaterials (
    const RoomWallMaterial & material
) const

Parameters:

  • material The new material.
SetDimensions

Sets the shape's dimensions of this room.

void Amplitude::Room::SetDimensions (
    AmVector3 dimensions
) const

Parameters:

  • dimensions The new dimensions.
SetGain

Sets the room effects gain.

void Amplitude::Room::SetGain (
    AmReal32 gain
) const

Parameters:

  • gain The gain applied to early reflections and reverberations effects.
SetLocation

Sets the location room.

void Amplitude::Room::SetLocation (
    const AmVector3 & location
) const

Parameters:

  • location The new location.
SetOrientation

Sets the orientation of this room.

void Amplitude::Room::SetOrientation (
    const Orientation & orientation
) const

Parameters:

  • orientation The new orientation.
SetShape

Sets the shape representing this room.

void Amplitude::Room::SetShape (
    const BoxShape & shape
) const

Parameters:

  • shape The new shape.
SetWallMaterial

Sets the material for a specific wall of this room.

void Amplitude::Room::SetWallMaterial (
    eRoomWall wall,
    const RoomWallMaterial & material
) const

Parameters:

  • wall The wall to set the material for.
  • material The 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:

  • leftWallMaterial The material for the left wall.
  • rightWallMaterial The material for the right wall.
  • floorMaterial The material for the floor.
  • ceilingMaterial The material for the ceiling.
  • frontWallMaterial The material for the front wall.
  • backWallMaterial The material for the back wall.
Update

Updates the state of this room.

void Amplitude::Room::Update () const

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.

bool Amplitude::Room::Valid () const

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