All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
FireworksModule.h
1 // Copyright eeGeo Ltd (2012-2014), All Rights Reserved
2 
3 #pragma once
4 
5 #include "IFireworksLocationRepository.h"
6 #include "Rendering.h"
7 #include "Types.h"
8 #include "VectorMath.h"
9 #include "Camera.h"
10 #include "GLHelpers.h"
11 #include "IRenderableFilter.h"
12 #include "Helpers.h"
13 #include "Modules.h"
14 #include "Fireworks.h"
15 #include "Random.h"
16 #include "Streaming.h"
17 #include "Terrain.h"
18 #include <vector>
19 #include <string>
20 
21 namespace Eegeo
22 {
23  namespace Modules
24  {
33  {
34  public:
36  /* \param particleTextureFileName the local image file to be used for the firework particles. For best results, use a 32-bit greyscale png.
37  * \param glBufferPool reference to GLBufferPool component
38  * \param vertexBindingPool reference to VertexBindingPool component
39  * \param vertexLayoutPool reference to VertexLayoutPool component
40  * \param shaderIdGenerator reference to ShaderIdGenerator component
41  * \param materialIdGenerator reference to MaterialIdGenerator component
42  * \param textureFileLoader reference to ITextureFileLoader component
43  * \param renderableFilters reference to RenderableFilters component
44  * \param streamingController reference to StreamingController component
45  * \param cameraFrustum reference to CameraFrustumStreamingVolume component
46  * \param terrainHeightProvider reference to TerrainHeightProvider component
47  */
48  FireworksModule(const std::string& particleTextureFileName,
49  Rendering::GlBufferPool& glBufferPool,
52  Rendering::Shaders::ShaderIdGenerator& shaderIdGenerator,
53  Rendering::Materials::MaterialIdGenerator& materialIdGenerator,
54  Helpers::ITextureFileLoader& textureFileLoader,
55  Rendering::RenderableFilters& renderableFilters,
56  Streaming::StreamingController& streamingController,
59  ~FireworksModule();
60 
62  /* \param particleTextureFileName the local image file to be used for the firework particles. For best results, use a 32-bit greyscale png.
63  * \param renderingModule reference to RenderingModule
64  * \param platformAbstractonModule reference to PlatformAbstractionModule
65  * \param streamingModule reference to StreamingModule.
66  * \param mapModule reference to MapModule.
67  * \param terrainModelModule reference to TerrainModelModule.
68  * \return A FireworksModule object.
69  */
70  static FireworksModule* Create(const std::string& particleTextureFileName,
71  const Modules::Core::RenderingModule& renderingModule,
73  Modules::Map::StreamingModule& streamingModule,
74  Modules::Map::MapModule& mapModule,
75  Modules::Map::Layers::TerrainModelModule& terrainModelModule);
76 
78  /* \param dt time in seconds that has past since last frame. Used to control the speed of the fireworks animation
79  * \param renderCamera a reference to the current RenderCamera being used to display the scene.
80  */
81  void Update(float dt, const Camera::RenderCamera& renderCamera);
82 
84  /* \param uid A unique identifying number for this location. Using the same number for two different locations will result in an assert.
85  * \param location A reference to a FireworksLocationConfiguration that defines all the properties you wish for this fireworks display to have, such as location, time of display and chance of appearing.
86  */
88 
90  // \param uid A unique identifying number for the location you wish to remove that was defined when calling AddFireworksLocation. Calling an unrecognised uid will result in an assert.
91  void RemoveFireworksLocation(u32 uid);
92 
94  void Clear();
95 
96  private:
97 
98  Random m_random;
99 
100  Rendering::Renderables::BatchedSpriteRenderable* m_pBatchedSpriteRenderable;
101 
104  Helpers::GLHelpers::TextureInfo m_textureInfo;
105  Rendering::RenderableFilters& m_renderableFilters;
106 
107  Fireworks::FireworksSequenceFactory* m_pSequenceFactory;
108  Fireworks::FireworksLocationRepository* m_pLocationRepository;
109  Fireworks::FireworksDisplayService* m_pDisplayService;
110  Fireworks::FireworksRenderableFilter* m_pRenderableFilter;
111  };
112  }
113 }