MoveEvent.h 731 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #ifndef ANKI_EVENT_MOVE_EVENT_H
  2. #define ANKI_EVENT_MOVE_EVENT_H
  3. #include "anki/event/Event.h"
  4. #include "anki/Math.h"
  5. namespace anki {
  6. // Forward
  7. class SceneNode;
  8. /// @addtogroup Events
  9. /// @{
  10. /// Helper class
  11. struct MoveEventData
  12. {
  13. Vec3 posMin;
  14. Vec3 posMax;
  15. };
  16. /// An event for simple movable animations
  17. class MoveEvent: public Event, private MoveEventData
  18. {
  19. public:
  20. /// @name Constructors/Destructor
  21. /// @{
  22. /// Constructor
  23. MoveEvent(EventManager* manager, F32 startTime, F32 duration,
  24. SceneNode* movableSceneNode, const MoveEventData& data);
  25. /// @}
  26. /// Implements Event::update
  27. void update(F32 prevUpdateTime, F32 crntTime);
  28. private:
  29. Vec3 originalPos;
  30. Vec3 newPos;
  31. };
  32. /// @}
  33. } // end namespace anki
  34. #endif