aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/others/irrlicht-1.8.1/source/Irrlicht/CParticleFadeOutAffector.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/others/irrlicht-1.8.1/source/Irrlicht/CParticleFadeOutAffector.h')
-rw-r--r--src/others/irrlicht-1.8.1/source/Irrlicht/CParticleFadeOutAffector.h63
1 files changed, 63 insertions, 0 deletions
diff --git a/src/others/irrlicht-1.8.1/source/Irrlicht/CParticleFadeOutAffector.h b/src/others/irrlicht-1.8.1/source/Irrlicht/CParticleFadeOutAffector.h
new file mode 100644
index 0000000..b39d559
--- /dev/null
+++ b/src/others/irrlicht-1.8.1/source/Irrlicht/CParticleFadeOutAffector.h
@@ -0,0 +1,63 @@
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_FADE_OUT_AFFECTOR_H_INCLUDED__
6#define __C_PARTICLE_FADE_OUT_AFFECTOR_H_INCLUDED__
7
8#include "IParticleFadeOutAffector.h"
9#include "SColor.h"
10
11namespace irr
12{
13namespace scene
14{
15
16//! Particle Affector for fading out a color
17class CParticleFadeOutAffector : public IParticleFadeOutAffector
18{
19public:
20
21 CParticleFadeOutAffector(const video::SColor& targetColor, u32 fadeOutTime);
22
23 //! Affects a particle.
24 virtual void affect(u32 now, SParticle* particlearray, u32 count);
25
26 //! Sets the targetColor, i.e. the color the particles will interpolate
27 //! to over time.
28 virtual void setTargetColor( const video::SColor& targetColor ) { TargetColor = targetColor; }
29
30 //! Sets the amount of time it takes for each particle to fade out.
31 virtual void setFadeOutTime( u32 fadeOutTime ) { FadeOutTime = fadeOutTime ? static_cast<f32>(fadeOutTime) : 1.0f; }
32
33 //! Sets the targetColor, i.e. the color the particles will interpolate
34 //! to over time.
35 virtual const video::SColor& getTargetColor() const { return TargetColor; }
36
37 //! Sets the amount of time it takes for each particle to fade out.
38 virtual u32 getFadeOutTime() const { return static_cast<u32>(FadeOutTime); }
39
40 //! Writes attributes of the object.
41 //! Implement this to expose the attributes of your scene node animator for
42 //! scripting languages, editors, debuggers or xml serialization purposes.
43 virtual void serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options) const;
44
45 //! Reads attributes of the object.
46 //! Implement this to set the attributes of your scene node animator for
47 //! scripting languages, editors, debuggers or xml deserialization purposes.
48 //! \param startIndex: start index where to start reading attributes.
49 //! \return: returns last index of an attribute read by this affector
50 virtual void deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options);
51
52private:
53
54 video::SColor TargetColor;
55 f32 FadeOutTime;
56};
57
58} // end namespace scene
59} // end namespace irr
60
61
62#endif
63