CSceneNodeAnimatorFlyStraight.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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_SCENE_NODE_ANIMATOR_FLY_STRAIGHT_H_INCLUDED__
  5. #define __C_SCENE_NODE_ANIMATOR_FLY_STRAIGHT_H_INCLUDED__
  6. #include "ISceneNodeAnimatorFinishing.h"
  7. namespace irr
  8. {
  9. namespace scene
  10. {
  11. class CSceneNodeAnimatorFlyStraight : public ISceneNodeAnimatorFinishing
  12. {
  13. public:
  14. //! constructor
  15. CSceneNodeAnimatorFlyStraight(const core::vector3df& startPoint,
  16. const core::vector3df& endPoint,
  17. u32 timeForWay,
  18. bool loop, u32 now, bool pingpong);
  19. //! animates a scene node
  20. virtual void animateNode(ISceneNode* node, u32 timeMs);
  21. //! Writes attributes of the scene node animator.
  22. virtual void serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options=0) const;
  23. //! Reads attributes of the scene node animator.
  24. virtual void deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options=0);
  25. //! Returns type of the scene node animator
  26. virtual ESCENE_NODE_ANIMATOR_TYPE getType() const { return ESNAT_FLY_STRAIGHT; }
  27. //! Creates a clone of this animator.
  28. /** Please note that you will have to drop
  29. (IReferenceCounted::drop()) the returned pointer after calling this. */
  30. virtual ISceneNodeAnimator* createClone(ISceneNode* node, ISceneManager* newManager=0);
  31. private:
  32. void recalculateIntermediateValues();
  33. core::vector3df Start;
  34. core::vector3df End;
  35. core::vector3df Vector;
  36. f32 TimeFactor;
  37. u32 StartTime;
  38. u32 TimeForWay;
  39. bool Loop;
  40. bool PingPong;
  41. };
  42. } // end namespace scene
  43. } // end namespace irr
  44. #endif