VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtBallisticSoundStream.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 <vrvAudio/vrvAudio.h>
15 
16 #include <vrvCore/DtUniqueID.h>
17 
18 #include <matrix/vlVector.h>
19 
20 #include <memory>
21 #include <string>
22 #include <vector>
23 
24 namespace makVrv
25 {
26 
27  class DtDe;
28 
49  {
50  public:
52  enum class State
53  {
54  Free,
55  Playing,
56  Draining
57  };
58 
60  static constexpr float theDrainSecs = 0.5f;
61 
64 
66  virtual ~DtBallisticSoundStream();
67 
69  DtBallisticSoundStream& operator=(const DtBallisticSoundStream&) = delete;
71  DtBallisticSoundStream& operator=(DtBallisticSoundStream&&) = default;
72 
73  // -----------------------------------------------------------------------
74  // Initialization
75  // -----------------------------------------------------------------------
76 
88  virtual bool init(DtDe& de,
89  DtUniqueID streamId,
90  const std::vector<DtBallisticSoundGroup>& groups);
91 
92  // -----------------------------------------------------------------------
93  // State queries
94  // -----------------------------------------------------------------------
95 
98  virtual bool isFree() const;
99 
103  virtual bool ownsRequest(DtUniqueID burstId) const;
104 
107  virtual State state() const;
108 
109  // -----------------------------------------------------------------------
110  // Trigger
111  // -----------------------------------------------------------------------
112 
129  virtual void triggerGroup(const std::string& groupName,
130  const DtVector& worldPos,
131  const DtVector& vel,
132  float decibels,
133  float linearGain,
134  float pitchFactor,
135  DtUniqueID burstId);
136 
137  // -----------------------------------------------------------------------
138  // Per-frame update
139  // -----------------------------------------------------------------------
140 
148  virtual void tick(double dt, double simTime);
149 
150  protected:
152  std::unique_ptr<DtProceduralSound> myStream;
153 
156 
159 
161  double myDrainStart;
162  };
163 
164 } // namespace makVrv
DT_DLL_EXAMPLESCENEROOTPLUGIN void init(DtDe &anIG)
DtUniqueID myAssignedBurstId
Burst-record ID of the currently assigned burst; 0 when Free.
Definition: DtBallisticSoundStream.h:158
Contains the DLL export macro for vrvAudio classes.
One slot in the ballistic proximity sound stream pool.
Definition: DtBallisticSoundStream.h:48
State myState
Current lifecycle state.
Definition: DtBallisticSoundStream.h:155
Contains makVrv::DtProceduralSound class.
std::unique_ptr< DtProceduralSound > myStream
Underlying stream; null until init() succeeds.
Definition: DtBallisticSoundStream.h:152
unsigned long long DtUniqueID
Definition: DtUniqueID.h:19
Contains makVrv::DtUniqueID type.
#define DT_DLL_VRVAUDIO
Definition: vrvAudio.h:20
The DtDe is the core component of any VR-Vantage application. It owns a DtRenderer, DtDeCommunicator, as well as a DtDisplay and other things.
Definition: DtDe.h:76
double myDrainStart
Simulation time at which the slot entered the Draining state.
Definition: DtBallisticSoundStream.h:161
State
Lifecycle states of the stream slot.
Definition: DtBallisticSoundStream.h:52
Contains the DtBallisticSoundGroup struct declaration.

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)