Transform.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. #ifndef TRANSFORM_H
  2. #define TRANSFORM_H
  3. #include "Vec3.h"
  4. #include "Mat3.h"
  5. #include "MathCommonIncludes.h"
  6. /// @addtogroup Math
  7. /// @{
  8. /// For transformations
  9. class Transform
  10. {
  11. public:
  12. /// @name Constructors
  13. /// @{
  14. explicit Transform();
  15. Transform(const Transform& b);
  16. explicit Transform(const Mat4& m4);
  17. explicit Transform(const Vec3& origin, const Mat3& rotation_,
  18. const float scale_);
  19. /// @}
  20. /// @name Accessors
  21. /// @{
  22. const Vec3& getOrigin() const;
  23. Vec3& getOrigin();
  24. void setOrigin(const Vec3 o);
  25. const Mat3& getRotation() const;
  26. Mat3& getRotation();
  27. void setRotation(const Mat3& r);
  28. float getScale() const;
  29. float& getScale();
  30. void setScale(const float s);
  31. /// @}
  32. /// @name Operators with same
  33. /// @{
  34. Transform& operator=(const Transform& b);
  35. /// @}
  36. /// @name Other
  37. /// @{
  38. void setIdentity();
  39. static const Transform& getIdentity();
  40. static Transform combineTransformations(const Transform& a,
  41. const Transform& b); ///< @see m::combineTransformations
  42. /// @}
  43. private:
  44. /// @name Data
  45. /// @{
  46. Vec3 origin; ///< The rotation
  47. Mat3 rotation; ///< The translation
  48. float scale; ///< The uniform scaling
  49. /// @}
  50. };
  51. #include "Transform.inl.h"
  52. #endif