Pure data and signal container that decouples DtOsgBallisticManager from the audio subsystem.
DtOsgBallisticManager owns one instance of this proxy as a member. vrvAudio obtains the proxy via DtOsgBallisticManager::soundProxy(), attaches a resolver, connects to signal_soundTriggers, and pushes query settings. The proxy itself has no knowledge of DtBallisticComputeComponent beyond what is needed to drain sound triggers from it.
- See Also
- DtOsgBallisticManager, DtBallisticSoundTrigger
| makVrv::DtBallisticSoundProxy::DtBallisticSoundProxy |
( |
| ) |
|
Constructs the proxy with sound query disabled and default settings.
| virtual makVrv::DtBallisticSoundProxy::~DtBallisticSoundProxy |
( |
| ) |
|
|
virtualdefault |
| virtual void makVrv::DtBallisticSoundProxy::setSoundIndexResolver |
( |
const SoundIndexResolver & |
resolver | ) |
|
|
virtual |
Registers the callable that resolves group names to GPU indices.
- Parameters
-
| resolver | Callable; the proxy stores a copy. |
| virtual void makVrv::DtBallisticSoundProxy::setSoundQueryEnabled |
( |
bool |
enabled | ) |
|
|
virtual |
Enables or disables the proximity sound query on the GPU.
- Parameters
-
| enabled | True to enable; false to disable. |
| virtual void makVrv::DtBallisticSoundProxy::setSoundQueryRadius |
( |
float |
radius | ) |
|
|
virtual |
Sets the detection radius for the proximity sound query.
- Parameters
-
| radius | Detection radius in meters. |
| virtual void makVrv::DtBallisticSoundProxy::setSoundQueryMaxResults |
( |
int |
n | ) |
|
|
virtual |
| virtual bool makVrv::DtBallisticSoundProxy::soundQueryEnabled |
( |
| ) |
const |
|
virtual |
Returns true when the proximity sound query is enabled.
| virtual float makVrv::DtBallisticSoundProxy::soundQueryRadius |
( |
| ) |
const |
|
virtual |
Returns the detection radius in meters.
| virtual int makVrv::DtBallisticSoundProxy::soundQueryMaxResults |
( |
| ) |
const |
|
virtual |
Returns the maximum number of query results per frame.
| virtual void makVrv::DtBallisticSoundProxy::notifyBulletSpawned |
( |
uint32_t |
bulletSlot, |
|
|
uint64_t |
burstId |
|
) |
| |
|
virtual |
Records that a bullet has been spawned from a fire burst.
Called by DtOsgBallisticManager::spawnOneRound() after a GPU slot is assigned. Stores the mapping from GPU slot index to burst-record ID so that drainAndFire() can enrich outgoing triggers with myFireRequestId.
- Parameters
-
| bulletSlot | GPU StateBuffer slot index of the new bullet. |
| burstId | DtBallisticBurstRecord::myId for this burst. |
| virtual void makVrv::DtBallisticSoundProxy::notifyBulletRetired |
( |
uint32_t |
bulletSlot | ) |
|
|
virtual |
Removes the slot-to-burst mapping for a bullet that has left the pool.
Called by DtOsgBallisticManager when a slot is released back to the GPU pool.
- Parameters
-
| bulletSlot | GPU StateBuffer slot index being freed. |
| virtual void makVrv::DtBallisticSoundProxy::notifyBurstFired |
( |
uint64_t |
burstId, |
|
|
const Vector3_64 & |
muzzleWorldPos |
|
) |
| |
|
virtual |
Records the world-space muzzle position for a fire burst.
Called once per burst (not per round) by DtOsgBallisticManager::fire(). Enriches outgoing DtBallisticSoundTrigger records with the muzzle position so that DtBallisticSoundManager can suppress flyby triggers whose shooter is within the observer's proximity detection radius.
- Parameters
-
| burstId | DtBallisticBurstRecord::myId for this burst. |
| muzzleWorldPos | World-space muzzle position in meters at fire time. |
| virtual void makVrv::DtBallisticSoundProxy::notifyBurstRetired |
( |
uint64_t |
burstId | ) |
|
|
virtual |
Removes the muzzle-position record for a burst that has ended.
Called by DtOsgBallisticManager at every burst-record erase site so the map does not accumulate stale entries.
- Parameters
-
| burstId | DtBallisticBurstRecord::myId of the retiring burst. |
Drains pending triggers from compute and fires signal_soundTriggers if the batch is non-empty.
Called from DtOsgBallisticManager::slot_postTick() on the simulation thread.
- Parameters
-
| compute | The compute component to drain. |
| virtual int32_t makVrv::DtBallisticSoundProxy::resolveGroupIndex |
( |
const std::string & |
groupName | ) |
const |
|
virtual |
Delegates group-name-to-index resolution to the registered resolver.
Returns -1 if no resolver has been set or if the group name is empty.
- Parameters
-
| groupName | Sound group name. |
- Returns
- 0-based stable index, or -1 if unresolvable.
| boost::signalslib::signal<void(const std::vector<DtBallisticSoundTrigger>&)> makVrv::DtBallisticSoundProxy::signal_soundTriggers |
Callable registered by vrvAudio to map group names to GPU indices.
| bool makVrv::DtBallisticSoundProxy::mySoundQueryEnabled |
|
protected |
True when the proximity sound query is active.
| float makVrv::DtBallisticSoundProxy::mySoundQueryRadius |
|
protected |
Detection radius in meters for the proximity sound query.
| int makVrv::DtBallisticSoundProxy::mySoundQueryMaxResults |
|
protected |
Maximum number of query results per frame.
Per-bullet last-known raw result for bullets currently approaching within range.
Key: StateBuffer slot index (bulletID). Value: most recent raw result for that bullet. A bullet is added when first seen with myCpaT > 1 (approaching, not yet at CPA). Its entry is updated each frame until it either reaches CPA or disappears (near-miss).
- See Also
- drainAndFire()
| std::set<uint32_t> makVrv::DtBallisticSoundProxy::myFiredWithinZoneIds |
|
protected |
Bullet IDs that have already fired a within-zone trigger (myCpaT == -1 sentinel). Prevents re-triggering on every frame the bullet remains inside the detection zone. Entries are erased when the bullet leaves the GPU readback result set.
- See Also
- drainAndFire()
| std::set<uint32_t> makVrv::DtBallisticSoundProxy::myFiredFlybySoundIds |
|
protected |
Bullet IDs that have already fired a flyby trigger (myCpaT in (0, 1]). Prevents duplicate triggers when myCpaT falls in the active window across consecutive frames. Entries are erased when the bullet leaves the GPU readback result set.
- See Also
- drainAndFire()
| std::unordered_map<uint32_t, uint64_t> makVrv::DtBallisticSoundProxy::mySlotToFireRequestId |
|
protected |
| std::unordered_map<uint64_t, Vector3_64> makVrv::DtBallisticSoundProxy::myBurstIdToMuzzlePos |
|
protected |
The documentation for this class was generated from the following file: