VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtBallisticSoundProxy.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * Copyright (c) 2026 MAK Technologies, Inc.
3  * All rights reserved.
4  *****************************************************************************/
5 
9 
10 #pragma once
11 
12 #include <vrvOsg/vrvOsg.h>
14 
15 #include <vrvUtil/signalslib.h>
16 
17 #include <cstdint>
18 #include <functional>
19 #include <map>
20 #include <set>
21 #include <string>
22 #include <unordered_map>
23 #include <vector>
24 
25 namespace makVrv
26 {
27 
28  class DtBallisticComputeComponent;
29 
42  {
43  public:
49  using SoundIndexResolver = std::function<int32_t(const std::string&)>;
50 
55  boost::signalslib::signal<void(const std::vector<DtBallisticSoundTrigger>&)> signal_soundTriggers;
56 
59 
61  virtual ~DtBallisticSoundProxy() = default;
62 
65  virtual void setSoundIndexResolver(const SoundIndexResolver& resolver);
66 
69  virtual void setSoundQueryEnabled(bool enabled);
70 
73  virtual void setSoundQueryRadius(float radius);
74 
81  virtual void setSoundQueryMaxResults(int n);
82 
84  virtual bool soundQueryEnabled() const;
85 
87  virtual float soundQueryRadius() const;
88 
90  virtual int soundQueryMaxResults() const;
91 
100  virtual void notifyBulletSpawned(uint32_t bulletSlot, uint64_t burstId);
101 
106  virtual void notifyBulletRetired(uint32_t bulletSlot);
107 
117  virtual void notifyBurstFired(uint64_t burstId, const Vector3_64& muzzleWorldPos);
118 
125  virtual void notifyBurstRetired(uint64_t burstId);
126 
132  virtual void drainAndFire(DtBallisticComputeComponent& compute);
133 
139  virtual int32_t resolveGroupIndex(const std::string& groupName) const;
140 
141  protected:
144 
147 
150 
153 
160  std::map<uint32_t, DtBallisticSoundTrigger> myPendingRangeTriggers;
161 
166  std::set<uint32_t> myFiredWithinZoneIds;
167 
172  std::set<uint32_t> myFiredFlybySoundIds;
173 
178  std::unordered_map<uint32_t, uint64_t> mySlotToFireRequestId;
179 
184  std::unordered_map<uint64_t, Vector3_64> myBurstIdToMuzzlePos;
185 
186  private:
188  DtBallisticSoundProxy& operator=(const DtBallisticSoundProxy&) = delete;
189  };
190 
191 } // namespace makVrv
std::map< uint32_t, DtBallisticSoundTrigger > myPendingRangeTriggers
Per-bullet last-known raw result for bullets currently approaching within range.
Definition: DtBallisticSoundProxy.h:160
SoundIndexResolver mySoundIndexResolver
Callable registered by vrvAudio to map group names to GPU indices.
Definition: DtBallisticSoundProxy.h:143
#define DT_DLL_VRVOSG
Definition: vrvOsg.h:23
Plain data struct for cross-thread transfer of a ballistic flyby sound trigger.Written by the render ...
std::set< uint32_t > myFiredWithinZoneIds
Bullet IDs that have already fired a within-zone trigger (myCpaT == -1 sentinel). Prevents re-trigger...
Definition: DtBallisticSoundProxy.h:166
std::unordered_map< uint64_t, Vector3_64 > myBurstIdToMuzzlePos
Maps burst-record ID to the world-space muzzle position at fire time.
Definition: DtBallisticSoundProxy.h:184
Pure data and signal container that decouples DtOsgBallisticManager from the audio subsystem...
Definition: DtBallisticSoundProxy.h:41
float mySoundQueryRadius
Detection radius in meters for the proximity sound query.
Definition: DtBallisticSoundProxy.h:149
Interface for GPU compute operations driving the ballistic simulation pipeline.
Definition: DtBallisticComputeComponent.h:71
int mySoundQueryMaxResults
Maximum number of query results per frame.
Definition: DtBallisticSoundProxy.h:152
std::set< uint32_t > myFiredFlybySoundIds
Bullet IDs that have already fired a flyby trigger (myCpaT in (0, 1]). Prevents duplicate triggers wh...
Definition: DtBallisticSoundProxy.h:172
Contains DLL export macros.
bool mySoundQueryEnabled
True when the proximity sound query is active.
Definition: DtBallisticSoundProxy.h:146
std::unordered_map< uint32_t, uint64_t > mySlotToFireRequestId
Maps GPU StateBuffer slot index to the burst-record ID of the spawning burst.
Definition: DtBallisticSoundProxy.h:178
std::function< int32_t(const std::string &)> SoundIndexResolver
Callable that maps a sound group name to a stable 0-based GPU index.
Definition: DtBallisticSoundProxy.h:49

Document ID: Generated on Thu Oct 15 21:27:02 EDT 2026 from SVN revision 296421
Copyright © 2005-2026 MAK Technologies. All Rights Reserved (www.mak.com)