VR-Vantage API Documentation
exSoundPlayer.h
Go to the documentation of this file.
1 /********************************************************************
2  * Copyright (c) 2012 MaK Technologies, Inc.
3  * All rights reserved.
4  ********************************************************************/
5 
9 
10 #pragma once
11 
13 
15 
16 #include <soundSys/soundMapper.h>
17 
18 #include <vl/detonateInter.h>
19 #include <vl/fireInter.h>
20 
21 #include <string>
22 
23 class DtEntityType;
24 class DtExerciseConn;
25 class DtReflectedEntity;
27 
28 namespace makVrv
29 {
30 
36  {
37  public:
38 
45  DtExerciseSoundPlayer( DtExerciseConn* exConn, DtReflectedEntityList* rel,
46  const char* mtlFilename );
47 
56  DtExerciseSoundPlayer( DtExerciseConn* exConn, DtReflectedEntityList* rel,
57  DtSoundMapper* soundMapper );
58 
60  virtual ~DtExerciseSoundPlayer();
61 
68  virtual void tick( DtConstVector viewPosition,
69  DtConstVector viewVelocity, const DtTaitBryan &viewAngle );
70 
75  virtual void mapEntitySound(const DtEntityType& entity,
76  const std::string filename);
77 
80  virtual void removeEntitySoundMap(const DtEntityType& entity);
81 
88  virtual void mapFireSound(const DtEntityType& entity,
89  const std::string filename, double duration = -1.0, int channel = 0);
90 
93  virtual void removeFireSoundMap(const DtEntityType& entity);
94 
102  virtual void mapDetonationSound(const DtEntityType& entity,
103  const std::string filename, double duration = -1.0, int channel = 0,
104  int result = -1);
105 
109  virtual void removeDetonationSoundMap(const DtEntityType& entity,
110  int result = -1);
111 
113  virtual void clearSoundMappings();
114 
118  virtual void recycleSoundSources();
119 
122  const DtSoundMapper* soundMapper() const;
123 
124  protected:
125 
130  virtual bool initialize( DtExerciseConn* exConn,
131  DtReflectedEntityList* rel );
132 
135  virtual void registerCallbacks();
136 
139  virtual void unregisterCallbacks();
140 
143 
145  static void entityAddedCb( DtReflectedEntity* entity, void* caller );
146 
148  static void entityRemovedCb( DtReflectedEntity* entity, void* caller );
149 
151  static void fireInteractionCb( DtFireInteraction* fire, void* caller );
152 
154  static void detonationInteractionCb( DtDetonationInteraction* detonation,
155  void* caller);
156 
158 
161 
164  virtual void onEntityAdded( DtReflectedEntity* entity );
165 
168  virtual void onEntityRemoved( DtReflectedEntity* entity );
169 
172  virtual void onFireInteraction( DtFireInteraction* fire );
173 
176  virtual void onDetonationInteraction(
177  DtDetonationInteraction* detonation );
178 
180 
183  virtual void onRecycleSoundSources();
184 
187  virtual void addEntitiesFromList(DtReflectedEntityList* rel);
188 
191  virtual void removeEntitiesFromList(DtReflectedEntityList* rel);
192 
193  protected:
194 
196  DtSoundMapper* mySoundMapper;
197  DtVector myLastViewPos;
198  DtVector myLastViewVel;
199  DtTaitBryan myLastViewOri;
201 
202  private:
203 
207 
210  DtExerciseSoundPlayer& operator = ( const DtExerciseSoundPlayer& orig );
211 
212  };
213 
214 }


Copyright © 2005-2013 VT MÄK. All Rights Reserved (www.mak.com)