AxisAngle.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. // David Eberly, Geometric Tools, Redmond WA 98052
  2. // Copyright (c) 1998-2020
  3. // Distributed under the Boost Software License, Version 1.0.
  4. // https://www.boost.org/LICENSE_1_0.txt
  5. // https://www.geometrictools.com/License/Boost/LICENSE_1_0.txt
  6. // Version: 4.0.2019.08.13
  7. #pragma once
  8. #include <Mathematics/Vector.h>
  9. namespace WwiseGTE
  10. {
  11. // Axis-angle representation for N = 3 or N = 4. When N = 4, the axis
  12. // must be a vector of the form (x,y,z,0) [affine representation of the
  13. // 3-tuple direction].
  14. template <int N, typename Real>
  15. class AxisAngle
  16. {
  17. public:
  18. AxisAngle()
  19. :
  20. axis(Vector<N, Real>::Zero()),
  21. angle((Real)0)
  22. {
  23. static_assert(N == 3 || N == 4, "Dimension must be 3 or 4.");
  24. }
  25. AxisAngle(Vector<N, Real> const& inAxis, Real inAngle)
  26. :
  27. axis(inAxis),
  28. angle(inAngle)
  29. {
  30. static_assert(N == 3 || N == 4, "Dimension must be 3 or 4.");
  31. }
  32. Vector<N, Real> axis;
  33. Real angle;
  34. };
  35. }