FSoundPropagation
- Module
- Audio
- Header
#include "Audio/SoundPropagation.h"- Namespace
Mowo
Properties
| Type | Name | Description |
|---|---|---|
static constexpr float | kSearchDbPerMeter | Route cost per metre while searching, in dB. Only a tie-break between routes whose portals cost the same; the chosen route's real spreading is computed exactly afterwards. Default 0.1f. |
Public functions
| Returns | Name | Description |
|---|---|---|
void | Build | |
void | Clear | |
const std::vector<FSoundRoom>& | GetRooms | |
const std::vector<FSoundPortal>& | GetPortals | |
int32_t | RoomAt | -1 when the point is outside every room. |
int32_t | FindRoomById | |
const FSoundPortal* | FindPortal | |
const FSoundPortal* | FindCrossedPortal | The least lossy linking portal whose opening the straight segment passes through, or null. |
bool | FindRoute | The quietest-loss chain of portals between two rooms; false when none. |
FSoundPath | Evaluate | physics may be null — then only the portal graph answers. |
FSoundPath | Evaluate | The straight route traced against acoustic geometry (the scan hierarchy) instead of the physics scene. |
FSoundPath | Evaluate | The world's live graph and the geometry its sound is traced against: the acoustic geometry installed for it (FGeometricAcoustics) when there is one and audio.Acoustics is on, else its physics scene; the straight trace alone when the world runs no FSoundPropagationSystem. |
FSoundPath | Evaluate | |
void | MixPortal | The open/closed energy mix of one opening. |
void | DrawDebug | Rooms as boxes, portals as their opening, and a line from every portal to the centres of the rooms it joins — under the Audio debug category. |
Function details
Build
void Build(World& world)Clear
void Clear()GetRooms
const std::vector<FSoundRoom>& GetRooms() constGetPortals
const std::vector<FSoundPortal>& GetPortals() constRoomAt
int32_t RoomAt(const Vec3& point) const-1 when the point is outside every room.
FindRoomById
int32_t FindRoomById(const std::string& roomId) constFindPortal
const FSoundPortal* FindPortal(EntityID entity) constFindCrossedPortal
const FSoundPortal* FindCrossedPortal(const Vec3& from, const Vec3& to) constThe least lossy linking portal whose opening the straight segment passes through, or null.
FindRoute
bool FindRoute(int32_t fromRoom, const Vec3& from, int32_t toRoom, const Vec3& to, FSoundPath& outPath) constThe quietest-loss chain of portals between two rooms; false when none.
Evaluate
FSoundPath Evaluate(const PhysicsWorld* physics, const Vec3& from, const Vec3& to, uint32_t layerMask) constphysics may be null — then only the portal graph answers.
Evaluate
FSoundPath Evaluate(const IAcousticGeometry& geometry, const Vec3& from, const Vec3& to) constThe straight route traced against acoustic geometry (the scan hierarchy) instead of the physics scene.
Evaluate
static FSoundPath Evaluate(World& world, const Vec3& from, const Vec3& to, uint32_t layerMask)The world's live graph and the geometry its sound is traced against: the acoustic geometry installed for it (FGeometricAcoustics) when there is one and audio.Acoustics is on, else its physics scene; the straight trace alone when the world runs no FSoundPropagationSystem. The layer mask filters physics only — acoustic geometry carries its own layers.
Evaluate
static FSoundPath Evaluate(World& world, const Vec3& from, const Vec3& to)MixPortal
static void MixPortal(float openFraction, float openDb, float openCutoffHz, float closedDb, float closedCutoffHz, float& outDb, float& outCutoffHz)The open/closed energy mix of one opening.
DrawDebug
void DrawDebug() constRooms as boxes, portals as their opening, and a line from every portal to the centres of the rooms it joins — under the Audio debug category.