aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/others/irrlicht-1.8.1/source/Irrlicht/CParticleGravityAffector.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/others/irrlicht-1.8.1/source/Irrlicht/CParticleGravityAffector.h')
-rw-r--r--src/others/irrlicht-1.8.1/source/Irrlicht/CParticleGravityAffector.h64
1 files changed, 64 insertions, 0 deletions
diff --git a/src/others/irrlicht-1.8.1/source/Irrlicht/CParticleGravityAffector.h b/src/others/irrlicht-1.8.1/source/Irrlicht/CParticleGravityAffector.h
new file mode 100644
index 0000000..5491b51
--- /dev/null
+++ b/src/others/irrlicht-1.8.1/source/Irrlicht/CParticleGravityAffector.h
@@ -0,0 +1,64 @@
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 __C_PARTICLE_GRAVITY_AFFECTOR_H_INCLUDED__
6#define __C_PARTICLE_GRAVITY_AFFECTOR_H_INCLUDED__
7
8#include "IParticleGravityAffector.h"
9#include "SColor.h"
10
11namespace irr
12{
13namespace scene
14{
15
16//! Particle Affector for affecting direction of particle
17class CParticleGravityAffector : public IParticleGravityAffector
18{
19public:
20
21 CParticleGravityAffector(
22 const core::vector3df& gravity = core::vector3df(0.0f,-0.03f,0.0f),
23 u32 timeForceLost = 1000);
24
25 //! Affects a particle.
26 virtual void affect(u32 now, SParticle* particlearray, u32 count);
27
28 //! Set the time in milliseconds when the gravity force is totally
29 //! lost and the particle does not move any more.
30 virtual void setTimeForceLost( f32 timeForceLost ) { TimeForceLost = timeForceLost; }
31
32 //! Set the direction and force of gravity.
33 virtual void setGravity( const core::vector3df& gravity ) { Gravity = gravity; }
34
35 //! Set the time in milliseconds when the gravity force is totally
36 //! lost and the particle does not move any more.
37 virtual f32 getTimeForceLost() const { return TimeForceLost; }
38
39 //! Set the direction and force of gravity.
40 virtual const core::vector3df& getGravity() const { return Gravity; }
41
42 //! Writes attributes of the object.
43 //! Implement this to expose the attributes of your scene node animator for
44 //! scripting languages, editors, debuggers or xml serialization purposes.
45 virtual void serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options) const;
46
47 //! Reads attributes of the object.
48 //! Implement this to set the attributes of your scene node animator for
49 //! scripting languages, editors, debuggers or xml deserialization purposes.
50 //! \param startIndex: start index where to start reading attributes.
51 //! \return: returns last index of an attribute read by this affector
52 virtual void deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options);
53
54private:
55 f32 TimeForceLost;
56 core::vector3df Gravity;
57};
58
59} // end namespace scene
60} // end namespace irr
61
62
63#endif
64