All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
FireworksSequence.h
1 // Copyright eeGeo Ltd (2012-2014), All Rights Reserved
2 
3 #pragma once
4 
5 #include "Fireworks.h"
6 #include "Camera.h"
7 #include "Rendering.h"
8 #include "VectorMath.h"
9 #include "Random.h"
10 #include "Streaming.h"
11 #include "FireworksSequenceBurstConfiguration.h"
12 #include <vector>
13 
14 namespace Eegeo
15 {
16  namespace Fireworks
17  {
19  {
21  FireworkEmitter* pEmitter;
22  bool hasFired;
23  };
24 
26  {
27  public:
28 
29  FireworksSequence(const dv3& ecefOrigin,
30  std::vector<FireworksSequenceBurstConfiguration>& burstConfig,
32  Streaming::CameraFrustumStreamingVolume& cameraFrustumStreamingVolume,
33  Random& random);
35 
36  bool IsPlaying() const;
37 
38  void PlaySequence();
39  void Update(float dt, const Camera::RenderCamera& renderCamera);
40  void SetEcefOrigin(const dv3& ecefOrigin);
41 
42  private:
43 
44  void CreateEmitters(const dv3& ecefOrigin, std::vector<FireworksSequenceBurstConfiguration>& burstConfig);
45  void DestroyEmitters();
46 
47  bool AllBurstsFired() const;
48  bool AtLeastOneEmitterStillPlaying() const;
49  void ResetSequence();
50 
51  Random& m_random;
53  Streaming::CameraFrustumStreamingVolume& m_cameraFrustumStreamingVolume;
54  std::vector<FireworksSequenceScheduledEmitter> m_sequenceEmitters;
55  float m_sequenceTime;
56  bool m_isPlaying;
57  };
58  }
59 }