Pyrogenesis  trunk
ParticleManager.h
Go to the documentation of this file.
1 /* Copyright (C) 2011 Wildfire Games.
2  * This file is part of 0 A.D.
3  *
4  * 0 A.D. is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation, either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * 0 A.D. is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with 0 A.D. If not, see <http://www.gnu.org/licenses/>.
16  */
17 
18 #ifndef INCLUDED_PARTICLEMANAGER
19 #define INCLUDED_PARTICLEMANAGER
20 
23 
24 #include <boost/random/mersenne_twister.hpp>
25 #include <boost/unordered_map.hpp>
26 
27 class SceneCollector;
28 
30 {
31 public:
34 
36 
37  /**
38  * Tell the manager to handle rendering of an emitter that is no longer
39  * attached to a unit.
40  */
41  void AddUnattachedEmitter(const CParticleEmitterPtr& emitter);
42 
43  /**
44  * Delete unattached emitters if we don't wish to see them anymore (like in actor viewer)
45  */
47 
48  void RenderSubmit(SceneCollector& collector, const CFrustum& frustum);
49 
50  void Interpolate(const float simFrameLength);
51 
52  float GetCurrentTime() const { return m_CurrentTime; }
53 
54  Status ReloadChangedFile(const VfsPath& path);
55 
56  /// Random number generator shared between all particle emitters.
57  boost::mt19937 m_RNG;
58 
59 private:
61 
62  std::list<CParticleEmitterPtr> m_UnattachedEmitters;
63 
64  boost::unordered_map<VfsPath, CParticleEmitterTypePtr> m_EmitterTypes;
65 };
66 
67 #endif // INCLUDED_PARTICLEMANAGER
float m_CurrentTime
Definition: ParticleManager.h:60
shared_ptr< CParticleEmitterType > CParticleEmitterTypePtr
Definition: ParticleEmitterType.h:115
Definition: Frustum.h:39
shared_ptr< CParticleEmitter > CParticleEmitterPtr
Definition: ParticleEmitter.h:45
This interface accepts renderable objects.
Definition: Scene.h:83
boost::mt19937 m_RNG
Random number generator shared between all particle emitters.
Definition: ParticleManager.h:57
CParticleManager()
Definition: ParticleManager.cpp:31
Status ReloadChangedFile(const VfsPath &path)
Definition: ParticleManager.cpp:96
Definition: path.h:77
float GetCurrentTime() const
Definition: ParticleManager.h:52
void AddUnattachedEmitter(const CParticleEmitterPtr &emitter)
Tell the manager to handle rendering of an emitter that is no longer attached to a unit...
Definition: ParticleManager.cpp:53
i64 Status
Error handling system.
Definition: status.h:171
void Interpolate(const float simFrameLength)
Definition: ParticleManager.cpp:63
void ClearUnattachedEmitters()
Delete unattached emitters if we don&#39;t wish to see them anymore (like in actor viewer) ...
Definition: ParticleManager.cpp:58
Definition: ParticleManager.h:29
boost::unordered_map< VfsPath, CParticleEmitterTypePtr > m_EmitterTypes
Definition: ParticleManager.h:64
CParticleEmitterTypePtr LoadEmitterType(const VfsPath &path)
Definition: ParticleManager.cpp:42
~CParticleManager()
Definition: ParticleManager.cpp:37
std::list< CParticleEmitterPtr > m_UnattachedEmitters
Definition: ParticleManager.h:62
void RenderSubmit(SceneCollector &collector, const CFrustum &frustum)
Definition: ParticleManager.cpp:83