JitterMoveEvent.h 817 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. // Copyright (C) 2009-2021, 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. {
  10. /// @addtogroup scene
  11. /// @{
  12. /// An event for simple movable animations
  13. class JitterMoveEvent : public Event
  14. {
  15. public:
  16. /// Constructor
  17. JitterMoveEvent(EventManager* manager)
  18. : Event(manager)
  19. {
  20. }
  21. ANKI_USE_RESULT Error init(Second startTime, Second duration, SceneNode* movableSceneNode);
  22. /// Implements Event::update
  23. ANKI_USE_RESULT Error update(Second prevUpdateTime, Second crntTime);
  24. void setPositionLimits(const Vec4& posMin, const Vec4& posMax);
  25. private:
  26. Vec4 m_originalPos;
  27. Vec4 m_newPos;
  28. };
  29. /// @}
  30. } // end namespace anki