diff options
Diffstat (limited to 'src/others/irrlicht-1.8.1/include/IParticleSystemSceneNode.h')
-rw-r--r-- | src/others/irrlicht-1.8.1/include/IParticleSystemSceneNode.h | 512 |
1 files changed, 512 insertions, 0 deletions
diff --git a/src/others/irrlicht-1.8.1/include/IParticleSystemSceneNode.h b/src/others/irrlicht-1.8.1/include/IParticleSystemSceneNode.h new file mode 100644 index 0000000..adb2050 --- /dev/null +++ b/src/others/irrlicht-1.8.1/include/IParticleSystemSceneNode.h | |||
@@ -0,0 +1,512 @@ | |||
1 | // Copyright (C) 2002-2012 Nikolaus Gebhardt | ||
2 | // This file is part of the "Irrlicht Engine". | ||
3 | // For conditions of distribution and use, see copyright notice in irrlicht.h | ||
4 | |||
5 | #ifndef __I_PARTICLE_SYSTEM_SCENE_NODE_H_INCLUDED__ | ||
6 | #define __I_PARTICLE_SYSTEM_SCENE_NODE_H_INCLUDED__ | ||
7 | |||
8 | #include "ISceneNode.h" | ||
9 | #include "IParticleAnimatedMeshSceneNodeEmitter.h" | ||
10 | #include "IParticleBoxEmitter.h" | ||
11 | #include "IParticleCylinderEmitter.h" | ||
12 | #include "IParticleMeshEmitter.h" | ||
13 | #include "IParticleRingEmitter.h" | ||
14 | #include "IParticleSphereEmitter.h" | ||
15 | #include "IParticleAttractionAffector.h" | ||
16 | #include "IParticleFadeOutAffector.h" | ||
17 | #include "IParticleGravityAffector.h" | ||
18 | #include "IParticleRotationAffector.h" | ||
19 | #include "dimension2d.h" | ||
20 | |||
21 | namespace irr | ||
22 | { | ||
23 | namespace scene | ||
24 | { | ||
25 | |||
26 | //! A particle system scene node for creating snow, fire, exlosions, smoke... | ||
27 | /** A scene node controlling a particle System. The behavior of the particles | ||
28 | can be controlled by setting the right particle emitters and affectors. | ||
29 | You can for example easily create a campfire by doing this: | ||
30 | |||
31 | \code | ||
32 | scene::IParticleSystemSceneNode* p = scenemgr->addParticleSystemSceneNode(); | ||
33 | p->setParticleSize(core::dimension2d<f32>(20.0f, 10.0f)); | ||
34 | scene::IParticleEmitter* em = p->createBoxEmitter( | ||
35 | core::aabbox3d<f32>(-5,0,-5,5,1,5), | ||
36 | core::vector3df(0.0f,0.03f,0.0f), | ||
37 | 40,80, video::SColor(0,255,255,255),video::SColor(0,255,255,255), 1100,2000); | ||
38 | p->setEmitter(em); | ||
39 | em->drop(); | ||
40 | scene::IParticleAffector* paf = p->createFadeOutParticleAffector(); | ||
41 | p->addAffector(paf); | ||
42 | paf->drop(); | ||
43 | \endcode | ||
44 | |||
45 | */ | ||
46 | class IParticleSystemSceneNode : public ISceneNode | ||
47 | { | ||
48 | public: | ||
49 | |||
50 | //! Constructor | ||
51 | IParticleSystemSceneNode(ISceneNode* parent, ISceneManager* mgr, s32 id, | ||
52 | const core::vector3df& position = core::vector3df(0,0,0), | ||
53 | const core::vector3df& rotation = core::vector3df(0,0,0), | ||
54 | const core::vector3df& scale = core::vector3df(1.0f, 1.0f, 1.0f)) | ||
55 | : ISceneNode(parent, mgr, id, position, rotation, scale) {} | ||
56 | |||
57 | //! Sets the size of all particles. | ||
58 | virtual void setParticleSize( | ||
59 | const core::dimension2d<f32> &size = core::dimension2d<f32>(5.0f, 5.0f)) = 0; | ||
60 | |||
61 | //! Sets if the particles should be global. | ||
62 | /** If they are, the particles are affected by the movement of the | ||
63 | particle system scene node too, otherwise they completely ignore it. | ||
64 | Default is true. */ | ||
65 | virtual void setParticlesAreGlobal(bool global=true) = 0; | ||
66 | |||
67 | //! Remove all currently visible particles | ||
68 | virtual void clearParticles() = 0; | ||
69 | |||
70 | //! Do manually update the particles. | ||
71 | //! This should only be called when you want to render the node outside the scenegraph, | ||
72 | //! as the node will care about this otherwise automatically. | ||
73 | virtual void doParticleSystem(u32 time) = 0; | ||
74 | |||
75 | //! Gets the particle emitter, which creates the particles. | ||
76 | /** \return The particle emitter. Can be 0 if none is set. */ | ||
77 | virtual IParticleEmitter* getEmitter() =0; | ||
78 | |||
79 | //! Sets the particle emitter, which creates the particles. | ||
80 | /** A particle emitter can be created using one of the createEmitter | ||
81 | methods. For example to create and use a simple PointEmitter, call | ||
82 | IParticleEmitter* p = createPointEmitter(); setEmitter(p); p->drop(); | ||
83 | \param emitter: Sets the particle emitter. You can set this to 0 for | ||
84 | removing the current emitter and stopping the particle system emitting | ||
85 | new particles. */ | ||
86 | virtual void setEmitter(IParticleEmitter* emitter) = 0; | ||
87 | |||
88 | //! Adds new particle effector to the particle system. | ||
89 | /** A particle affector modifies the particles. For example, the FadeOut | ||
90 | affector lets all particles fade out after some time. It is created and | ||
91 | used in this way: | ||
92 | \code | ||
93 | IParticleAffector* p = createFadeOutParticleAffector(); | ||
94 | addAffector(p); | ||
95 | p->drop(); | ||
96 | \endcode | ||
97 | Please note that an affector is not necessary for the particle system to | ||
98 | work. | ||
99 | \param affector: New affector. */ | ||
100 | virtual void addAffector(IParticleAffector* affector) = 0; | ||
101 | |||
102 | //! Get a list of all particle affectors. | ||
103 | /** \return The list of particle affectors attached to this node. */ | ||
104 | virtual const core::list<IParticleAffector*>& getAffectors() const = 0; | ||
105 | |||
106 | //! Removes all particle affectors in the particle system. | ||
107 | virtual void removeAllAffectors() = 0; | ||
108 | |||
109 | //! Creates a particle emitter for an animated mesh scene node | ||
110 | /** \param node: Pointer to the animated mesh scene node to emit | ||
111 | particles from | ||
112 | \param useNormalDirection: If true, the direction of each particle | ||
113 | created will be the normal of the vertex that it's emitting from. The | ||
114 | normal is divided by the normalDirectionModifier parameter, which | ||
115 | defaults to 100.0f. | ||
116 | \param direction: Direction and speed of particle emission. | ||
117 | \param normalDirectionModifier: If the emitter is using the normal | ||
118 | direction then the normal of the vertex that is being emitted from is | ||
119 | divided by this number. | ||
120 | \param mbNumber: This allows you to specify a specific meshBuffer for | ||
121 | the IMesh* to emit particles from. The default value is -1, which | ||
122 | means a random meshBuffer picked from all of the meshes meshBuffers | ||
123 | will be selected to pick a random vertex from. If the value is 0 or | ||
124 | greater, it will only pick random vertices from the meshBuffer | ||
125 | specified by this value. | ||
126 | \param everyMeshVertex: If true, the emitter will emit between min/max | ||
127 | particles every second, for every vertex in the mesh, if false, it will | ||
128 | emit between min/max particles from random vertices in the mesh. | ||
129 | \param minParticlesPerSecond: Minimal amount of particles emitted per | ||
130 | second. | ||
131 | \param maxParticlesPerSecond: Maximal amount of particles emitted per | ||
132 | second. | ||
133 | \param minStartColor: Minimal initial start color of a particle. The | ||
134 | real color of every particle is calculated as random interpolation | ||
135 | between minStartColor and maxStartColor. | ||
136 | \param maxStartColor: Maximal initial start color of a particle. The | ||
137 | real color of every particle is calculated as random interpolation | ||
138 | between minStartColor and maxStartColor. | ||
139 | \param lifeTimeMin: Minimal lifetime of a particle, in milliseconds. | ||
140 | \param lifeTimeMax: Maximal lifetime of a particle, in milliseconds. | ||
141 | \param maxAngleDegrees: Maximal angle in degrees, the emitting | ||
142 | direction of the particle will differ from the original direction. | ||
143 | \param minStartSize: Minimal initial start size of a particle. The | ||
144 | real size of every particle is calculated as random interpolation | ||
145 | between minStartSize and maxStartSize. | ||
146 | \param maxStartSize: Maximal initial start size of a particle. The | ||
147 | real size of every particle is calculated as random interpolation | ||
148 | between minStartSize and maxStartSize. | ||
149 | \return Pointer to the created particle emitter. To set this emitter | ||
150 | as new emitter of this particle system, just call setEmitter(). Note | ||
151 | that you'll have to drop() the returned pointer, after you don't need | ||
152 | it any more, see IReferenceCounted::drop() for more informations. */ | ||
153 | virtual IParticleAnimatedMeshSceneNodeEmitter* createAnimatedMeshSceneNodeEmitter( | ||
154 | scene::IAnimatedMeshSceneNode* node, bool useNormalDirection = true, | ||
155 | const core::vector3df& direction = core::vector3df(0.0f,0.03f,0.0f), | ||
156 | f32 normalDirectionModifier = 100.0f, s32 mbNumber = -1, | ||
157 | bool everyMeshVertex = false, | ||
158 | u32 minParticlesPerSecond = 5, u32 maxParticlesPerSecond = 10, | ||
159 | const video::SColor& minStartColor = video::SColor(255,0,0,0), | ||
160 | const video::SColor& maxStartColor = video::SColor(255,255,255,255), | ||
161 | u32 lifeTimeMin = 2000, u32 lifeTimeMax = 4000, | ||
162 | s32 maxAngleDegrees = 0, | ||
163 | const core::dimension2df& minStartSize = core::dimension2df(5.0f,5.0f), | ||
164 | const core::dimension2df& maxStartSize = core::dimension2df(5.0f,5.0f) ) = 0; | ||
165 | |||
166 | //! Creates a box particle emitter. | ||
167 | /** \param box: The box for the emitter. | ||
168 | \param direction: Direction and speed of particle emission. | ||
169 | \param minParticlesPerSecond: Minimal amount of particles emitted per | ||
170 | second. | ||
171 | \param maxParticlesPerSecond: Maximal amount of particles emitted per | ||
172 | second. | ||
173 | \param minStartColor: Minimal initial start color of a particle. The | ||
174 | real color of every particle is calculated as random interpolation | ||
175 | between minStartColor and maxStartColor. | ||
176 | \param maxStartColor: Maximal initial start color of a particle. The | ||
177 | real color of every particle is calculated as random interpolation | ||
178 | between minStartColor and maxStartColor. | ||
179 | \param lifeTimeMin: Minimal lifetime of a particle, in milliseconds. | ||
180 | \param lifeTimeMax: Maximal lifetime of a particle, in milliseconds. | ||
181 | \param maxAngleDegrees: Maximal angle in degrees, the emitting | ||
182 | direction of the particle will differ from the original direction. | ||
183 | \param minStartSize: Minimal initial start size of a particle. The | ||
184 | real size of every particle is calculated as random interpolation | ||
185 | between minStartSize and maxStartSize. | ||
186 | \param maxStartSize: Maximal initial start size of a particle. The | ||
187 | real size of every particle is calculated as random interpolation | ||
188 | between minStartSize and maxStartSize. | ||
189 | \return Pointer to the created particle emitter. To set this emitter | ||
190 | as new emitter of this particle system, just call setEmitter(). Note | ||
191 | that you'll have to drop() the returned pointer, after you don't need | ||
192 | it any more, see IReferenceCounted::drop() for more informations. */ | ||
193 | virtual IParticleBoxEmitter* createBoxEmitter( | ||
194 | const core::aabbox3df& box = core::aabbox3df(-10,28,-10,10,30,10), | ||
195 | const core::vector3df& direction = core::vector3df(0.0f,0.03f,0.0f), | ||
196 | u32 minParticlesPerSecond = 5, | ||
197 | u32 maxParticlesPerSecond = 10, | ||
198 | const video::SColor& minStartColor = video::SColor(255,0,0,0), | ||
199 | const video::SColor& maxStartColor = video::SColor(255,255,255,255), | ||
200 | u32 lifeTimeMin=2000, u32 lifeTimeMax=4000, | ||
201 | s32 maxAngleDegrees=0, | ||
202 | const core::dimension2df& minStartSize = core::dimension2df(5.0f,5.0f), | ||
203 | const core::dimension2df& maxStartSize = core::dimension2df(5.0f,5.0f) ) = 0; | ||
204 | |||
205 | //! Creates a particle emitter for emitting from a cylinder | ||
206 | /** \param center: The center of the circle at the base of the cylinder | ||
207 | \param radius: The thickness of the cylinder | ||
208 | \param normal: Direction of the length of the cylinder | ||
209 | \param length: The length of the the cylinder | ||
210 | \param outlineOnly: Whether or not to put points inside the cylinder or | ||
211 | on the outline only | ||
212 | \param direction: Direction and speed of particle emission. | ||
213 | \param minParticlesPerSecond: Minimal amount of particles emitted per | ||
214 | second. | ||
215 | \param maxParticlesPerSecond: Maximal amount of particles emitted per | ||
216 | second. | ||
217 | \param minStartColor: Minimal initial start color of a particle. The | ||
218 | real color of every particle is calculated as random interpolation | ||
219 | between minStartColor and maxStartColor. | ||
220 | \param maxStartColor: Maximal initial start color of a particle. The | ||
221 | real color of every particle is calculated as random interpolation | ||
222 | between minStartColor and maxStartColor. | ||
223 | \param lifeTimeMin: Minimal lifetime of a particle, in milliseconds. | ||
224 | \param lifeTimeMax: Maximal lifetime of a particle, in milliseconds. | ||
225 | \param maxAngleDegrees: Maximal angle in degrees, the emitting | ||
226 | direction of the particle will differ from the original direction. | ||
227 | \param minStartSize: Minimal initial start size of a particle. The | ||
228 | real size of every particle is calculated as random interpolation | ||
229 | between minStartSize and maxStartSize. | ||
230 | \param maxStartSize: Maximal initial start size of a particle. The | ||
231 | real size of every particle is calculated as random interpolation | ||
232 | between minStartSize and maxStartSize. | ||
233 | \return Pointer to the created particle emitter. To set this emitter | ||
234 | as new emitter of this particle system, just call setEmitter(). Note | ||
235 | that you'll have to drop() the returned pointer, after you don't need | ||
236 | it any more, see IReferenceCounted::drop() for more informations. */ | ||
237 | virtual IParticleCylinderEmitter* createCylinderEmitter( | ||
238 | const core::vector3df& center, f32 radius, | ||
239 | const core::vector3df& normal, f32 length, | ||
240 | bool outlineOnly = false, | ||
241 | const core::vector3df& direction = core::vector3df(0.0f,0.03f,0.0f), | ||
242 | u32 minParticlesPerSecond = 5, u32 maxParticlesPerSecond = 10, | ||
243 | const video::SColor& minStartColor = video::SColor(255,0,0,0), | ||
244 | const video::SColor& maxStartColor = video::SColor(255,255,255,255), | ||
245 | u32 lifeTimeMin = 2000, u32 lifeTimeMax = 4000, | ||
246 | s32 maxAngleDegrees = 0, | ||
247 | const core::dimension2df& minStartSize = core::dimension2df(5.0f,5.0f), | ||
248 | const core::dimension2df& maxStartSize = core::dimension2df(5.0f,5.0f) ) = 0; | ||
249 | |||
250 | //! Creates a mesh particle emitter. | ||
251 | /** \param mesh: Pointer to mesh to emit particles from | ||
252 | \param useNormalDirection: If true, the direction of each particle | ||
253 | created will be the normal of the vertex that it's emitting from. The | ||
254 | normal is divided by the normalDirectionModifier parameter, which | ||
255 | defaults to 100.0f. | ||
256 | \param direction: Direction and speed of particle emission. | ||
257 | \param normalDirectionModifier: If the emitter is using the normal | ||
258 | direction then the normal of the vertex that is being emitted from is | ||
259 | divided by this number. | ||
260 | \param mbNumber: This allows you to specify a specific meshBuffer for | ||
261 | the IMesh* to emit particles from. The default value is -1, which | ||
262 | means a random meshBuffer picked from all of the meshes meshBuffers | ||
263 | will be selected to pick a random vertex from. If the value is 0 or | ||
264 | greater, it will only pick random vertices from the meshBuffer | ||
265 | specified by this value. | ||
266 | \param everyMeshVertex: If true, the emitter will emit between min/max | ||
267 | particles every second, for every vertex in the mesh, if false, it will | ||
268 | emit between min/max particles from random vertices in the mesh. | ||
269 | \param minParticlesPerSecond: Minimal amount of particles emitted per | ||
270 | second. | ||
271 | \param maxParticlesPerSecond: Maximal amount of particles emitted per | ||
272 | second. | ||
273 | \param minStartColor: Minimal initial start color of a particle. The | ||
274 | real color of every particle is calculated as random interpolation | ||
275 | between minStartColor and maxStartColor. | ||
276 | \param maxStartColor: Maximal initial start color of a particle. The | ||
277 | real color of every particle is calculated as random interpolation | ||
278 | between minStartColor and maxStartColor. | ||
279 | \param lifeTimeMin: Minimal lifetime of a particle, in milliseconds. | ||
280 | \param lifeTimeMax: Maximal lifetime of a particle, in milliseconds. | ||
281 | \param maxAngleDegrees: Maximal angle in degrees, the emitting | ||
282 | direction of the particle will differ from the original direction. | ||
283 | \param minStartSize: Minimal initial start size of a particle. The | ||
284 | real size of every particle is calculated as random interpolation | ||
285 | between minStartSize and maxStartSize. | ||
286 | \param maxStartSize: Maximal initial start size of a particle. The | ||
287 | real size of every particle is calculated as random interpolation | ||
288 | between minStartSize and maxStartSize. | ||
289 | \return Pointer to the created particle emitter. To set this emitter | ||
290 | as new emitter of this particle system, just call setEmitter(). Note | ||
291 | that you'll have to drop() the returned pointer, after you don't need | ||
292 | it any more, see IReferenceCounted::drop() for more informations. */ | ||
293 | virtual IParticleMeshEmitter* createMeshEmitter( | ||
294 | scene::IMesh* mesh, bool useNormalDirection = true, | ||
295 | const core::vector3df& direction = core::vector3df(0.0f,0.03f,0.0f), | ||
296 | f32 normalDirectionModifier = 100.0f, s32 mbNumber = -1, | ||
297 | bool everyMeshVertex = false, | ||
298 | u32 minParticlesPerSecond = 5, u32 maxParticlesPerSecond = 10, | ||
299 | const video::SColor& minStartColor = video::SColor(255,0,0,0), | ||
300 | const video::SColor& maxStartColor = video::SColor(255,255,255,255), | ||
301 | u32 lifeTimeMin = 2000, u32 lifeTimeMax = 4000, | ||
302 | s32 maxAngleDegrees = 0, | ||
303 | const core::dimension2df& minStartSize = core::dimension2df(5.0f,5.0f), | ||
304 | const core::dimension2df& maxStartSize = core::dimension2df(5.0f,5.0f) ) = 0; | ||
305 | |||
306 | //! Creates a point particle emitter. | ||
307 | /** \param direction: Direction and speed of particle emission. | ||
308 | \param minParticlesPerSecond: Minimal amount of particles emitted per | ||
309 | second. | ||
310 | \param maxParticlesPerSecond: Maximal amount of particles emitted per | ||
311 | second. | ||
312 | \param minStartColor: Minimal initial start color of a particle. The | ||
313 | real color of every particle is calculated as random interpolation | ||
314 | between minStartColor and maxStartColor. | ||
315 | \param maxStartColor: Maximal initial start color of a particle. The | ||
316 | real color of every particle is calculated as random interpolation | ||
317 | between minStartColor and maxStartColor. | ||
318 | \param lifeTimeMin: Minimal lifetime of a particle, in milliseconds. | ||
319 | \param lifeTimeMax: Maximal lifetime of a particle, in milliseconds. | ||
320 | \param maxAngleDegrees: Maximal angle in degrees, the emitting | ||
321 | direction of the particle will differ from the original direction. | ||
322 | \param minStartSize: Minimal initial start size of a particle. The | ||
323 | real size of every particle is calculated as random interpolation | ||
324 | between minStartSize and maxStartSize. | ||
325 | \param maxStartSize: Maximal initial start size of a particle. The | ||
326 | real size of every particle is calculated as random interpolation | ||
327 | between minStartSize and maxStartSize. | ||
328 | \return Pointer to the created particle emitter. To set this emitter | ||
329 | as new emitter of this particle system, just call setEmitter(). Note | ||
330 | that you'll have to drop() the returned pointer, after you don't need | ||
331 | it any more, see IReferenceCounted::drop() for more informations. */ | ||
332 | virtual IParticlePointEmitter* createPointEmitter( | ||
333 | const core::vector3df& direction = core::vector3df(0.0f,0.03f,0.0f), | ||
334 | u32 minParticlesPerSecond = 5, | ||
335 | u32 maxParticlesPerSecond = 10, | ||
336 | const video::SColor& minStartColor = video::SColor(255,0,0,0), | ||
337 | const video::SColor& maxStartColor = video::SColor(255,255,255,255), | ||
338 | u32 lifeTimeMin=2000, u32 lifeTimeMax=4000, | ||
339 | s32 maxAngleDegrees=0, | ||
340 | const core::dimension2df& minStartSize = core::dimension2df(5.0f,5.0f), | ||
341 | const core::dimension2df& maxStartSize = core::dimension2df(5.0f,5.0f) ) = 0; | ||
342 | |||
343 | //! Creates a ring particle emitter. | ||
344 | /** \param center: Center of ring | ||
345 | \param radius: Distance of points from center, points will be rotated | ||
346 | around the Y axis at a random 360 degrees and will then be shifted by | ||
347 | the provided ringThickness values in each axis. | ||
348 | \param ringThickness : thickness of the ring or how wide the ring is | ||
349 | \param direction: Direction and speed of particle emission. | ||
350 | \param minParticlesPerSecond: Minimal amount of particles emitted per | ||
351 | second. | ||
352 | \param maxParticlesPerSecond: Maximal amount of particles emitted per | ||
353 | second. | ||
354 | \param minStartColor: Minimal initial start color of a particle. The | ||
355 | real color of every particle is calculated as random interpolation | ||
356 | between minStartColor and maxStartColor. | ||
357 | \param maxStartColor: Maximal initial start color of a particle. The | ||
358 | real color of every particle is calculated as random interpolation | ||
359 | between minStartColor and maxStartColor. | ||
360 | \param lifeTimeMin: Minimal lifetime of a particle, in milliseconds. | ||
361 | \param lifeTimeMax: Maximal lifetime of a particle, in milliseconds. | ||
362 | \param maxAngleDegrees: Maximal angle in degrees, the emitting | ||
363 | direction of the particle will differ from the original direction. | ||
364 | \param minStartSize: Minimal initial start size of a particle. The | ||
365 | real size of every particle is calculated as random interpolation | ||
366 | between minStartSize and maxStartSize. | ||
367 | \param maxStartSize: Maximal initial start size of a particle. The | ||
368 | real size of every particle is calculated as random interpolation | ||
369 | between minStartSize and maxStartSize. | ||
370 | \return Pointer to the created particle emitter. To set this emitter | ||
371 | as new emitter of this particle system, just call setEmitter(). Note | ||
372 | that you'll have to drop() the returned pointer, after you don't need | ||
373 | it any more, see IReferenceCounted::drop() for more informations. */ | ||
374 | virtual IParticleRingEmitter* createRingEmitter( | ||
375 | const core::vector3df& center, f32 radius, f32 ringThickness, | ||
376 | const core::vector3df& direction = core::vector3df(0.0f,0.03f,0.0f), | ||
377 | u32 minParticlesPerSecond = 5, | ||
378 | u32 maxParticlesPerSecond = 10, | ||
379 | const video::SColor& minStartColor = video::SColor(255,0,0,0), | ||
380 | const video::SColor& maxStartColor = video::SColor(255,255,255,255), | ||
381 | u32 lifeTimeMin=2000, u32 lifeTimeMax=4000, | ||
382 | s32 maxAngleDegrees=0, | ||
383 | const core::dimension2df& minStartSize = core::dimension2df(5.0f,5.0f), | ||
384 | const core::dimension2df& maxStartSize = core::dimension2df(5.0f,5.0f) ) = 0; | ||
385 | |||
386 | //! Creates a sphere particle emitter. | ||
387 | /** \param center: Center of sphere | ||
388 | \param radius: Radius of sphere | ||
389 | \param direction: Direction and speed of particle emission. | ||
390 | \param minParticlesPerSecond: Minimal amount of particles emitted per | ||
391 | second. | ||
392 | \param maxParticlesPerSecond: Maximal amount of particles emitted per | ||
393 | second. | ||
394 | \param minStartColor: Minimal initial start color of a particle. The | ||
395 | real color of every particle is calculated as random interpolation | ||
396 | between minStartColor and maxStartColor. | ||
397 | \param maxStartColor: Maximal initial start color of a particle. The | ||
398 | real color of every particle is calculated as random interpolation | ||
399 | between minStartColor and maxStartColor. | ||
400 | \param lifeTimeMin: Minimal lifetime of a particle, in milliseconds. | ||
401 | \param lifeTimeMax: Maximal lifetime of a particle, in milliseconds. | ||
402 | \param maxAngleDegrees: Maximal angle in degrees, the emitting | ||
403 | direction of the particle will differ from the original direction. | ||
404 | \param minStartSize: Minimal initial start size of a particle. The | ||
405 | real size of every particle is calculated as random interpolation | ||
406 | between minStartSize and maxStartSize. | ||
407 | \param maxStartSize: Maximal initial start size of a particle. The | ||
408 | real size of every particle is calculated as random interpolation | ||
409 | between minStartSize and maxStartSize. | ||
410 | \return Pointer to the created particle emitter. To set this emitter | ||
411 | as new emitter of this particle system, just call setEmitter(). Note | ||
412 | that you'll have to drop() the returned pointer, after you don't need | ||
413 | it any more, see IReferenceCounted::drop() for more informations. */ | ||
414 | virtual IParticleSphereEmitter* createSphereEmitter( | ||
415 | const core::vector3df& center, f32 radius, | ||
416 | const core::vector3df& direction = core::vector3df(0.0f,0.03f,0.0f), | ||
417 | u32 minParticlesPerSecond = 5, | ||
418 | u32 maxParticlesPerSecond = 10, | ||
419 | const video::SColor& minStartColor = video::SColor(255,0,0,0), | ||
420 | const video::SColor& maxStartColor = video::SColor(255,255,255,255), | ||
421 | u32 lifeTimeMin=2000, u32 lifeTimeMax=4000, | ||
422 | s32 maxAngleDegrees=0, | ||
423 | const core::dimension2df& minStartSize = core::dimension2df(5.0f,5.0f), | ||
424 | const core::dimension2df& maxStartSize = core::dimension2df(5.0f,5.0f) ) = 0; | ||
425 | |||
426 | //! Creates a point attraction affector. | ||
427 | /** This affector modifies the positions of the particles and attracts | ||
428 | them to a specified point at a specified speed per second. | ||
429 | \param point: Point to attract particles to. | ||
430 | \param speed: Speed in units per second, to attract to the specified | ||
431 | point. | ||
432 | \param attract: Whether the particles attract or detract from this | ||
433 | point. | ||
434 | \param affectX: Whether or not this will affect the X position of the | ||
435 | particle. | ||
436 | \param affectY: Whether or not this will affect the Y position of the | ||
437 | particle. | ||
438 | \param affectZ: Whether or not this will affect the Z position of the | ||
439 | particle. | ||
440 | \return Pointer to the created particle affector. To add this affector | ||
441 | as new affector of this particle system, just call addAffector(). Note | ||
442 | that you'll have to drop() the returned pointer, after you don't need | ||
443 | it any more, see IReferenceCounted::drop() for more informations. */ | ||
444 | virtual IParticleAttractionAffector* createAttractionAffector( | ||
445 | const core::vector3df& point, f32 speed = 1.0f, bool attract = true, | ||
446 | bool affectX = true, bool affectY = true, bool affectZ = true) = 0; | ||
447 | |||
448 | //! Creates a scale particle affector. | ||
449 | /** This affector scales the particle to the a multiple of its size defined | ||
450 | by the scaleTo variable. | ||
451 | \param scaleTo: multiple of the size which the particle will be scaled to until deletion | ||
452 | \return Pointer to the created particle affector. | ||
453 | To add this affector as new affector of this particle system, | ||
454 | just call addAffector(). Note that you'll have to drop() the | ||
455 | returned pointer, after you don't need it any more, see | ||
456 | IReferenceCounted::drop() for more information. */ | ||
457 | virtual IParticleAffector* createScaleParticleAffector(const core::dimension2df& scaleTo = core::dimension2df(1.0f, 1.0f)) = 0; | ||
458 | |||
459 | //! Creates a fade out particle affector. | ||
460 | /** This affector modifies the color of every particle and and reaches | ||
461 | the final color when the particle dies. This affector looks really | ||
462 | good, if the EMT_TRANSPARENT_ADD_COLOR material is used and the | ||
463 | targetColor is video::SColor(0,0,0,0): Particles are fading out into | ||
464 | void with this setting. | ||
465 | \param targetColor: Color whereto the color of the particle is changed. | ||
466 | \param timeNeededToFadeOut: How much time in milli seconds should the | ||
467 | affector need to change the color to the targetColor. | ||
468 | \return Pointer to the created particle affector. To add this affector | ||
469 | as new affector of this particle system, just call addAffector(). Note | ||
470 | that you'll have to drop() the returned pointer, after you don't need | ||
471 | it any more, see IReferenceCounted::drop() for more informations. */ | ||
472 | virtual IParticleFadeOutAffector* createFadeOutParticleAffector( | ||
473 | const video::SColor& targetColor = video::SColor(0,0,0,0), | ||
474 | u32 timeNeededToFadeOut = 1000) = 0; | ||
475 | |||
476 | //! Creates a gravity affector. | ||
477 | /** This affector modifies the direction of the particle. It assumes | ||
478 | that the particle is fired out of the emitter with huge force, but is | ||
479 | loosing this after some time and is catched by the gravity then. This | ||
480 | affector is ideal for creating things like fountains. | ||
481 | \param gravity: Direction and force of gravity. | ||
482 | \param timeForceLost: Time in milli seconds when the force of the | ||
483 | emitter is totally lost and the particle does not move any more. This | ||
484 | is the time where gravity fully affects the particle. | ||
485 | \return Pointer to the created particle affector. To add this affector | ||
486 | as new affector of this particle system, just call addAffector(). Note | ||
487 | that you'll have to drop() the returned pointer, after you don't need | ||
488 | it any more, see IReferenceCounted::drop() for more informations. */ | ||
489 | virtual IParticleGravityAffector* createGravityAffector( | ||
490 | const core::vector3df& gravity = core::vector3df(0.0f,-0.03f,0.0f), | ||
491 | u32 timeForceLost = 1000) = 0; | ||
492 | |||
493 | //! Creates a rotation affector. | ||
494 | /** This affector modifies the positions of the particles and attracts | ||
495 | them to a specified point at a specified speed per second. | ||
496 | \param speed: Rotation in degrees per second | ||
497 | \param pivotPoint: Point to rotate the particles around | ||
498 | \return Pointer to the created particle affector. To add this affector | ||
499 | as new affector of this particle system, just call addAffector(). Note | ||
500 | that you'll have to drop() the returned pointer, after you don't need | ||
501 | it any more, see IReferenceCounted::drop() for more informations. */ | ||
502 | virtual IParticleRotationAffector* createRotationAffector( | ||
503 | const core::vector3df& speed = core::vector3df(5.0f,5.0f,5.0f), | ||
504 | const core::vector3df& pivotPoint = core::vector3df(0.0f,0.0f,0.0f) ) = 0; | ||
505 | }; | ||
506 | |||
507 | } // end namespace scene | ||
508 | } // end namespace irr | ||
509 | |||
510 | |||
511 | #endif | ||
512 | |||