Irrlicht 3D Engine
IParticleAffector.h
Go to the documentation of this file.
00001 // Copyright (C) 2002-2012 Nikolaus Gebhardt
00002 // This file is part of the "Irrlicht Engine".
00003 // For conditions of distribution and use, see copyright notice in irrlicht.h
00004 
00005 #ifndef __I_PARTICLE_AFFECTOR_H_INCLUDED__
00006 #define __I_PARTICLE_AFFECTOR_H_INCLUDED__
00007 
00008 #include "IAttributeExchangingObject.h"
00009 #include "SParticle.h"
00010 
00011 namespace irr
00012 {
00013 namespace scene
00014 {
00015 
00017 enum E_PARTICLE_AFFECTOR_TYPE
00018 {
00019     EPAT_NONE = 0,
00020     EPAT_ATTRACT,
00021     EPAT_FADE_OUT,
00022     EPAT_GRAVITY,
00023     EPAT_ROTATE,
00024     EPAT_SCALE,
00025     EPAT_COUNT
00026 };
00027 
00029 const c8* const ParticleAffectorTypeNames[] =
00030 {
00031     "None",
00032     "Attract",
00033     "FadeOut",
00034     "Gravity",
00035     "Rotate",
00036     "Scale",
00037     0
00038 };
00039 
00041 class IParticleAffector : public virtual io::IAttributeExchangingObject
00042 {
00043 public:
00044 
00046     IParticleAffector() : Enabled(true) {}
00047 
00049 
00052     virtual void affect(u32 now, SParticle* particlearray, u32 count) = 0;
00053 
00055     virtual void setEnabled(bool enabled) { Enabled = enabled; }
00056 
00058     virtual bool getEnabled() const { return Enabled; }
00059 
00061     virtual E_PARTICLE_AFFECTOR_TYPE getType() const = 0;
00062 
00063 protected:
00064     bool Enabled;
00065 };
00066 
00067 } // end namespace scene
00068 } // end namespace irr
00069 
00070 
00071 #endif
00072