JitterMoveEvent.h 785 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. // Copyright (C) 2009-2022, Panagiotis Christopoulos Charitos and contributors.
  2. // All rights reserved.
  3. // Code licensed under the BSD License.
  4. // http://www.anki3d.org/LICENSE
  5. #pragma once
  6. #include <AnKi/Scene/Events/Event.h>
  7. #include <AnKi/Math.h>
  8. namespace anki {
  9. /// @addtogroup scene
  10. /// @{
  11. /// An event for simple movable animations
  12. class JitterMoveEvent : public Event
  13. {
  14. public:
  15. /// Constructor
  16. JitterMoveEvent(EventManager* manager)
  17. : Event(manager)
  18. {
  19. }
  20. Error init(Second startTime, Second duration, SceneNode* movableSceneNode);
  21. /// Implements Event::update
  22. Error update(Second prevUpdateTime, Second crntTime);
  23. void setPositionLimits(const Vec4& posMin, const Vec4& posMax);
  24. private:
  25. Vec4 m_originalPos;
  26. Vec4 m_newPos;
  27. };
  28. /// @}
  29. } // end namespace anki