Otclient  14/8/2020
particleaffector.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 PARTICLEAFFECTOR_H
24 #define PARTICLEAFFECTOR_H
25 
26 #include "declarations.h"
27 #include <framework/otml/otml.h>
28 
30 {
31 public:
33 
34  void update(float elapsedTime);
35  virtual void load(const OTMLNodePtr& node);
36  virtual void updateParticle(const ParticlePtr&, float) {}
37 
38  bool hasFinished() { return m_finished; }
39 
40 protected:
44 };
45 
47 public:
48  void load(const OTMLNodePtr& node);
49  void updateParticle(const ParticlePtr& particle, float elapsedTime);
50 
51 private:
52  float m_angle, m_gravity;
53 };
54 
56 public:
57  void load(const OTMLNodePtr& node);
58  void updateParticle(const ParticlePtr& particle, float elapsedTime);
59 
60 private:
61  Point m_position;
62  float m_acceleration, m_reduction;
63  bool m_repelish;
64 };
65 
66 #endif
ParticleAffector::m_elapsedTime
float m_elapsedTime
Definition: particleaffector.h:43
AttractionAffector::load
void load(const OTMLNodePtr &node)
Definition: particleaffector.cpp:100
AttractionAffector
Definition: particleaffector.h:55
AttractionAffector::updateParticle
void updateParticle(const ParticlePtr &particle, float elapsedTime)
Definition: particleaffector.cpp:120
ParticleAffector
Definition: particleaffector.h:29
otml.h
ParticleAffector::m_finished
bool m_finished
Definition: particleaffector.h:41
ParticleAffector::m_active
bool m_active
Definition: particleaffector.h:41
GravityAffector::updateParticle
void updateParticle(const ParticlePtr &particle, float elapsedTime)
Definition: particleaffector.cpp:90
GravityAffector::load
void load(const OTMLNodePtr &node)
Definition: particleaffector.cpp:75
ParticleAffector::ParticleAffector
ParticleAffector()
Definition: particleaffector.cpp:27
GravityAffector
Definition: particleaffector.h:46
ParticleAffector::load
virtual void load(const OTMLNodePtr &node)
Definition: particleaffector.cpp:49
declarations.h
stdext::shared_object_ptr< OTMLNode >
ParticleAffector::updateParticle
virtual void updateParticle(const ParticlePtr &, float)
Definition: particleaffector.h:36
TPoint< int >
ParticleAffector::hasFinished
bool hasFinished()
Definition: particleaffector.h:38
stdext::shared_object
Definition: shared_object.h:41
ParticleAffector::m_duration
float m_duration
Definition: particleaffector.h:42
ParticleAffector::m_delay
float m_delay
Definition: particleaffector.h:42
ParticleAffector::update
void update(float elapsedTime)
Definition: particleaffector.cpp:36