CParticleRotationAffector.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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. #ifndef __C_PARTICLE_ROTATION_AFFECTOR_H_INCLUDED__
  5. #define __C_PARTICLE_ROTATION_AFFECTOR_H_INCLUDED__
  6. #include "IParticleRotationAffector.h"
  7. namespace irr
  8. {
  9. namespace scene
  10. {
  11. //! Particle Affector for rotating particles about a point
  12. class CParticleRotationAffector : public IParticleRotationAffector
  13. {
  14. public:
  15. CParticleRotationAffector( const core::vector3df& speed = core::vector3df(5.0f, 5.0f, 5.0f),
  16. const core::vector3df& point = core::vector3df() );
  17. //! Affects a particle.
  18. virtual void affect(u32 now, SParticle* particlearray, u32 count);
  19. //! Set the point that particles will attract to
  20. virtual void setPivotPoint( const core::vector3df& point ) { PivotPoint = point; }
  21. //! Set the speed in degrees per second
  22. virtual void setSpeed( const core::vector3df& speed ) { Speed = speed; }
  23. //! Get the point that particles are attracted to
  24. virtual const core::vector3df& getPivotPoint() const { return PivotPoint; }
  25. //! Get the speed in degrees per second
  26. virtual const core::vector3df& getSpeed() const { return Speed; }
  27. //! Writes attributes of the object.
  28. virtual void serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options) const;
  29. //! Reads attributes of the object.
  30. virtual void deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options);
  31. private:
  32. core::vector3df PivotPoint;
  33. core::vector3df Speed;
  34. u32 LastTime;
  35. };
  36. } // end namespace scene
  37. } // end namespace irr
  38. #endif // __C_PARTICLE_ROTATION_AFFECTOR_H_INCLUDED__