Otclient  14/8/2020
particleemitter.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2010-2020 OTClient <https://github.com/edubart/otclient>
3  *
4  * Permission is hereby granted, free of charge, to any person obtaining a copy
5  * of this software and associated documentation files (the "Software"), to deal
6  * in the Software without restriction, including without limitation the rights
7  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8  * copies of the Software, and to permit persons to whom the Software is
9  * furnished to do so, subject to the following conditions:
10  *
11  * The above copyright notice and this permission notice shall be included in
12  * all copies or substantial portions of the Software.
13  *
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20  * THE SOFTWARE.
21  */
22 
23 #ifndef PARTICLEEMITTER_H
24 #define PARTICLEEMITTER_H
25 
26 #include "declarations.h"
27 #include "painter.h"
28 #include <framework/global.h>
30 #include <framework/otml/otml.h>
31 
33 {
34 public:
36 
37  void load(const OTMLNodePtr& node);
38 
39  void update(float elapsedTime, const ParticleSystemPtr& system);
40 
41  bool hasFinished() { return m_finished; }
42 
43 private:
44  // self related
45  Point m_position;
46  float m_duration, m_delay;
47  float m_elapsedTime;
48  bool m_finished, m_active;
49  float m_burstRate;
50  int m_currentBurst, m_burstCount;
51  ParticleTypePtr m_particleType;
52 };
53 
54 #endif
otml.h
ParticleEmitter
Definition: particleemitter.h:32
ParticleEmitter::hasFinished
bool hasFinished()
Definition: particleemitter.h:41
painter.h
ParticleEmitter::update
void update(float elapsedTime, const ParticleSystemPtr &system)
Definition: particleemitter.cpp:65
ParticleEmitter::load
void load(const OTMLNodePtr &node)
Definition: particleemitter.cpp:43
ParticleEmitter::ParticleEmitter
ParticleEmitter()
Definition: particleemitter.cpp:30
declarations.h
texture.h
stdext::shared_object_ptr< OTMLNode >
TPoint< int >
global.h
stdext::shared_object
Definition: shared_object.h:41