All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
FireworkEmitter.h
1 // Copyright eeGeo Ltd (2012-2014), All Rights Reserved
2 
3 #pragma once
4 
5 #include "VectorMathDecl.h"
6 #include "Rendering.h"
7 #include "Camera.h"
8 #include "Random.h"
9 #include "VectorMath.h"
10 #include "Streaming.h"
11 #include "EcefTangentBasis.h"
12 #include <vector>
13 
14 namespace Eegeo
15 {
16  namespace Fireworks
17  {
19  {
20  v3 startPosition;
21  v3 endPosition;
22  v4 color;
23  };
24 
26  {
27  public:
28 
29  FireworkEmitter(int maxParticles, const dv3& ecefOrigin, Rendering::Renderables::BatchedSpriteRenderable& fireworksRenderable, Random& random);
30  ~FireworkEmitter();
31 
32  const bool IsPlaying() const { return m_isPlayingBurstAnimation; }
33 
34  void Update(float dt, const Camera::RenderCamera& renderCamera, Streaming::CameraFrustumStreamingVolume& cameraFrustumStreamingVolume);
35  void PlayBurstAnimation(const v3& offset, const v4& color, float burstSize);
36  void SetEcefOrigin(const dv3& ecefOrigin);
37 
38  private:
39 
40  Random& m_random;
41  Space::EcefTangentBasis m_tangentBasis;
42  std::vector<FireworkParticle> m_particles;
43  dv3 m_ecefOrigin;
44  dv3 m_ecefBurstOrigin;
45  v3 m_localUp;
46  v3 m_gravityFalloffOffset;
48 
49  float m_emitterTime;
50  float m_emitterDuration;
51  float m_particleSize;
52 
53  float m_burstRadius;
54 
55  bool m_isPlayingBurstAnimation;
56  };
57  }
58 }