CSceneNodeAnimatorFlyCircle.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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_CIRCLE_H_INCLUDED__
  5. #define __C_SCENE_NODE_ANIMATOR_FLY_CIRCLE_H_INCLUDED__
  6. #include "ISceneNode.h"
  7. namespace irr
  8. {
  9. namespace scene
  10. {
  11. class CSceneNodeAnimatorFlyCircle : public ISceneNodeAnimator
  12. {
  13. public:
  14. //! constructor
  15. CSceneNodeAnimatorFlyCircle(u32 time,
  16. const core::vector3df& center, f32 radius,
  17. f32 speed, const core::vector3df& direction,
  18. f32 radiusEllipsoid);
  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_CIRCLE; }
  27. //! Creates a clone of this animator.
  28. /** Please note that you will have to drop
  29. (IReferenceCounted::drop()) the returned pointer after calling
  30. this. */
  31. virtual ISceneNodeAnimator* createClone(ISceneNode* node, ISceneManager* newManager=0);
  32. private:
  33. // do some initial calculations
  34. void init();
  35. // circle center
  36. core::vector3df Center;
  37. // up-vector, normal to the circle's plane
  38. core::vector3df Direction;
  39. // Two helper vectors
  40. core::vector3df VecU;
  41. core::vector3df VecV;
  42. f32 Radius;
  43. f32 RadiusEllipsoid;
  44. f32 Speed;
  45. u32 StartTime;
  46. };
  47. } // end namespace scene
  48. } // end namespace irr
  49. #endif