ScummVM API documentation
te_particle.h
1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 #ifndef TETRAEDGE_TE_TE_PARTICLE_H
23 #define TETRAEDGE_TE_TE_PARTICLE_H
24 
25 #include "common/str.h"
26 #include "tetraedge/te/te_vector3f32.h"
27 #include "tetraedge/te/te_real_timer.h"
28 #include "tetraedge/te/te_intrusive_ptr.h"
29 #include "tetraedge/te/te_3d_texture.h"
30 #include "tetraedge/te/te_scene.h"
31 
32 namespace Tetraedge {
33 
35 public:
36  class TeElement : public TeModel {
37  public:
38  TeElement() : _elapsedTime(0), _yOffset(0) {}
39  float _elapsedTime;
40  float _yOffset;
41  TeVector3f32 _direction;
42  };
43 
44  TeParticle(TeScene *scene);
45  ~TeParticle();
46 
47  void setName(const Common::String &name) { _name = name; }
48  bool loadTexture(const Common::String &name);
49  void setPosition(const TeVector3f32 &pos) { _position = pos; }
50  void setDirection(const TeVector3f32 &dir) { _direction = dir; }
51  void setSize(float size) { _size = size; }
52  void setVolumeSize(const TeVector3f32 &size) { _volumeSize = size; }
53  void setStartColor(const TeColor &col) { _startColor = col; }
54  void setEndColor(const TeColor &col) { _endColor = col; }
55  void setColorTime(int time) { _colorTime = time; }
56  void setTime(int time) { _time = time; }
57  void setPeriod(int period) { _period = period; }
58  void setParticlePerPeriod(int val) { _particlePerPeriod = val; }
59  void setEnabled(bool enabled) { _enabled = enabled; }
60  void setStartLoop(int startloop) { _startLoop = startloop; }
61  void setGravity(float gravity) { _gravity = gravity; }
62  void setRandomDir(bool val) { _randomDir = val; }
63  void setOrientation(const TeVector3f32 &orientation);
64  void setMatrix(const TeMatrix4x4 &mat) { _matrix = mat; }
65 
66  void update(int val);
67 
68  int startLoop() const { return _startLoop; }
69  TeRealTimer realTimer() { return _realTimer; }
70 
71  static int getIndex(const Common::String &name);
72  static TeParticle *getIndexedParticle(int idx);
73  static void cleanup();
74 
75  static void deleteAll();
76  static void updateAll(int val);
77 
78 private:
81  TeScene *_scene;
82  TeRealTimer _realTimer;
83  Common::String _name;
85  TeVector3f32 _position;
86  TeVector3f32 _direction;
87  float _size;
88  TeVector3f32 _volumeSize;
89  TeColor _startColor;
90  TeColor _endColor;
91  int _colorTime;
92  int _time;
93  int _lastTime;
94  int _period;
95  int _particlePerPeriod;
96  bool _enabled;
97  int _startLoop;
98  float _gravity;
99  bool _randomDir;
100  TeMatrix4x4 _matrix;
101  TeMatrix4x4 _orientMatrix;
102 
103  static Common::Array<TeParticle *> *indexedParticles();
104  static Common::Array<TeParticle *> *_indexedParticles;
105 };
106 
107 } // end namespace Tetraedge
108 
109 #endif // TETRAEDGE_TE_TE_PARTICLE_H
Definition: te_particle.h:34
Definition: str.h:59
Definition: detection.h:27
Definition: array.h:52
Definition: list.h:44
Definition: te_color.h:30
Definition: te_model.h:44
Definition: te_matrix4x4.h:37
Definition: te_real_timer.h:28
Definition: te_intrusive_ptr.h:31
Definition: te_vector3f32.h:33
Definition: te_particle.h:36
Definition: te_scene.h:35
Definition: te_references_counter.h:27