FSoundRoom
FSoundPropagation — rooms joined by portals, and the one answer to "how does a sound get from here to there". World sources, proximity voice, radio speakers and AI hearing all ask Evaluate; that the creature and the player get the same answer through the same door is the point of it.
- Module
- Audio
- Header
#include "Audio/SoundPropagation.h"- Namespace
Mowo
The answer is the LOUDER of two routes. Straight through the walls is FSoundOcclusion's material trace. Round through the openings is the chain of portals from the source's room to the listener's, each portal adding its own authored loss and cutoff, plus what the detour costs in spreading (20·log10 of path length over straight distance). Between two rooms a straight line that hits no collision either runs out through an opening — and costs what that opening costs — or it crosses the author's room boundary where the level has no collision yet (a greybox), which counts as one thick wall: an author who drew two rooms meant them apart. Two rooms with no chain of portals at all are sealed and hear each other only through the walls.
Rooms and portals are built from RoomVolumeComponent / PortalComponent every tick by FSoundPropagationSystem — a door that swings changes the next query. Where no system runs, Evaluate falls back to the material trace alone.
Properties
| Type | Name | Description |
|---|---|---|
EntityID | entity | Default INVALID_ENTITY. |
std::string | roomId | |
Mat4 | world | Default Mat4(1.0f). |
Mat4 | worldToLocal | Default Mat4(1.0f). |
Vec3 | center | Default Vec3(0.0f, 0.0f, 0.0f). |
Vec3 | halfExtents | Default Vec3(1.0f, 1.0f, 1.0f). |
float | volume | Default 0.0f. |
int32_t | priority | Default 0. |