TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
UprightFrame.h
Go to the documentation of this file.
1 
6 #ifndef G3D_UprightFrame_h
7 #define G3D_UprightFrame_h
8 
9 #include "G3D/platform.h"
10 #include "G3D/Spline.h"
11 #include "G3D/Any.h"
12 #include "G3D/CoordinateFrame.h"
13 
14 namespace G3D {
15 
23 class UprightFrame {
24 public:
25 
27 
29  float pitch;
30 
32  float yaw;
33 
34  UprightFrame(const Vector3& t = Vector3::zero(), float p = 0, float y = 0)
35  : translation(t), pitch(p), yaw(y) {}
36 
37  UprightFrame(const CoordinateFrame& cframe);
38 
47  explicit UprightFrame(const Any& any);
48 
49  Any toAny() const;
50 
51  UprightFrame& operator=(const Any& any);
52 
54  operator CoordinateFrame() const {
55  return toCoordinateFrame();
56  }
57 
59 
61  UprightFrame operator+(const UprightFrame& other) const;
62 
64  UprightFrame operator*(const float k) const;
65 
71  static void unwrapYaw(UprightFrame* a, int N);
72 
73  void serialize(class BinaryOutput& b) const;
74  void deserialize(class BinaryInput& b);
75 };
76 
82 class UprightSpline : public Spline<UprightFrame> {
83 protected:
84 
85  virtual void ensureShortestPath(UprightFrame* A, int N) const {
87  }
88 
89 public:
90  UprightSpline();
91 
92 
103  explicit UprightSpline(const Any& any);
104 
105  virtual Any toAny(const std::string& myName) const override;
106 
107  Any toAny() const;
108 
109  UprightSpline& operator=(const Any& any);
110 
111  void serialize(class BinaryOutput& b) const;
112  void deserialize(class BinaryInput& b);
113 };
114 
115 }
116 
117 #endif
void deserialize(class BinaryInput &b)
Definition: UprightFrame.cpp:109
Definition: Spline.h:115
Definition: BinaryInput.h:69
Any toAny() const
Definition: UprightFrame.cpp:166
A rigid body RT (rotation-translation) transformation.
Definition: CoordinateFrame.h:59
float yaw
Definition: UprightFrame.h:32
void serialize(class BinaryOutput &b) const
Definition: UprightFrame.cpp:177
void deserialize(class BinaryInput &b)
Definition: UprightFrame.cpp:191
Definition: AABox.h:25
bool any(float x)
Definition: g3dmath.h:424
Definition: Vector3.h:58
UprightSpline & operator=(const Any &any)
Definition: UprightFrame.cpp:171
float pitch
Definition: UprightFrame.h:29
Any toAny() const
Definition: UprightFrame.cpp:33
UprightFrame operator+(const UprightFrame &other) const
Definition: UprightFrame.cpp:62
static const Vector3 & zero()
Definition: Vector3.cpp:119
Easy loading and saving of human-readable configuration files.
Definition: Any.h:184
Shortest-path linear velocity spline for camera positions. Always keeps the camera from rolling...
Definition: UprightFrame.h:82
UprightFrame & operator=(const Any &any)
Definition: UprightFrame.cpp:44
G3D::int16 y
Definition: Vector2int16.h:38
void serialize(class BinaryOutput &b) const
Definition: UprightFrame.cpp:102
UprightFrame(const Vector3 &t=Vector3::zero(), float p=0, float y=0)
Definition: UprightFrame.h:34
virtual void ensureShortestPath(UprightFrame *A, int N) const
Definition: UprightFrame.h:85
UprightSpline()
Definition: UprightFrame.cpp:117
static void unwrapYaw(UprightFrame *a, int N)
Definition: UprightFrame.cpp:72
Definition: BinaryOutput.h:52
CoordinateFrame toCoordinateFrame() const
Definition: UprightFrame.cpp:49
Vector3 translation
Definition: UprightFrame.h:26
Coordinate frame expressed in Euler angles. Unlike a G3D::Quat, UprightFrame always keeps the referen...
Definition: UprightFrame.h:23
UprightFrame operator*(const float k) const
Definition: UprightFrame.cpp:67