BsAnimationUtility.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536
  1. //********************************** Banshee Engine (www.banshee3d.com) **************************************************//
  2. //**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
  3. #pragma once
  4. #include "BsCorePrerequisites.h"
  5. #include "BsAnimationCurve.h"
  6. namespace BansheeEngine
  7. {
  8. /** @addtogroup Animation
  9. * @{
  10. */
  11. /** Helper class for dealing with animations, animation clips and curves. */
  12. class BS_CORE_EXPORT AnimationUtility
  13. {
  14. public:
  15. /**
  16. * Wraps or clamps the provided time value between the provided range.
  17. *
  18. * @param[in,out] time Time value to wrap/clamp.
  19. * @param[in] start Start of the range.
  20. * @param[in] end End of the range.
  21. * @param[in] loop If true the value will be wrapped, otherwise clamped to range.
  22. */
  23. static void wrapTime(float& time, float start, float end, bool loop);
  24. /** Converts a curve in euler angles (in degrees) into a curve using quaternions. */
  25. static TAnimationCurve<Quaternion> eulerToQuaternionCurve(const TAnimationCurve<Vector3>& eulerCurve);
  26. /** Converts a curve in quaternions into a curve using euler angles (in degrees). */
  27. static TAnimationCurve<Vector3> quaternionToEulerCurve(const TAnimationCurve<Quaternion>& quatCurve);
  28. };
  29. /** @} */
  30. }