------------------------------------------------------------------------------ Rotation Interop Utility class Useful for easily handling rotations/orientations in transforms while manipulating or converting between formats.
| 48 | /// |
| 49 | /// Useful for easily handling rotations/orientations in transforms while manipulating or converting between formats. |
| 50 | class RotationF |
| 51 | { |
| 52 | //-------------------------------------- Public data |
| 53 | public: |
| 54 | F32 x; ///< X co-ordinate. |
| 55 | F32 y; ///< Y co-ordinate. |
| 56 | F32 z; ///< Z co-ordinate. |
| 57 | F32 w; ///< W co-ordinate. |
| 58 | |
| 59 | enum RotationTypes |
| 60 | { |
| 61 | Euler = 0, |
| 62 | AxisAngle |
| 63 | }; |
| 64 | RotationTypes mRotationType; |
| 65 | |
| 66 | enum UnitFormat |
| 67 | { |
| 68 | Radians = 0, |
| 69 | Degrees |
| 70 | }; |
| 71 | |
| 72 | RotationF(); ///< Create an uninitialized point. |
| 73 | RotationF(const RotationF&); ///< Copy constructor. |
| 74 | |
| 75 | // |
| 76 | //Eulers |
| 77 | RotationF(EulerF euler, UnitFormat format = Radians); |
| 78 | RotationF(F32 _x, F32 _y, F32 _z, UnitFormat format = Radians); |
| 79 | |
| 80 | void set(EulerF euler, UnitFormat format = Radians); |
| 81 | void set(F32 _x, F32 _y, F32 _z, UnitFormat format = Radians); |
| 82 | |
| 83 | //As with AxisAngles, we make the assumption here that if not told otherwise, inbound rotations are in Degrees. |
| 84 | RotationF operator=(const EulerF&); |
| 85 | RotationF operator-(const EulerF&) const; |
| 86 | RotationF operator+(const EulerF&) const; |
| 87 | RotationF& operator-=(const EulerF&); |
| 88 | RotationF& operator+=(const EulerF&); |
| 89 | S32 operator==(const EulerF&) const; |
| 90 | S32 operator!=(const EulerF&) const; |
| 91 | |
| 92 | // |
| 93 | //AxisAngle |
| 94 | RotationF(AngAxisF aa, UnitFormat format = Radians); |
| 95 | void set(AngAxisF aa, UnitFormat format = Radians); |
| 96 | |
| 97 | //As with Eulers, we make the assumption here that if not told otherwise, inbound rotations are in Degrees. |
| 98 | RotationF operator=(const AngAxisF&); |
| 99 | RotationF operator-(const AngAxisF&) const; |
| 100 | RotationF operator+(const AngAxisF&) const; |
| 101 | RotationF& operator-=(const AngAxisF&); |
| 102 | RotationF& operator+=(const AngAxisF&); |
| 103 | S32 operator==(const AngAxisF&) const; |
| 104 | S32 operator!=(const AngAxisF&) const; |
| 105 | |
| 106 | // |
| 107 | //Quat |
no test coverage detected