30 # pragma warning (disable : 4127)
85 return !(*
this == other);
100 rotation(
Matrix3::identity()), translation(_translation) {
104 rotation(rotation), translation(translation) {
108 rotation(rotation), translation(
Point3::
zero()) {
131 rotation(other.rotation), translation(other.translation) {}
148 void getXYZYPRRadians(
float&
x,
float&
y,
float&
z,
float& yaw,
float& pitch,
float& roll)
const;
149 void getXYZYPRDegrees(
float&
x,
float&
y,
float&
z,
float& yaw,
float& pitch,
float& roll)
const;
156 std::string
toXML()
const;
168 float angle = -(float) atan2(-look.
x, look.
z);
193 (rotation[0][0] * v[0] + rotation[0][1] * v[1] + rotation[0][2] * v[2] + translation[0],
194 rotation[1][0] * v[0] + rotation[1][1] * v[1] + rotation[1][2] * v[2] + translation[1],
195 rotation[2][0] * v[0] + rotation[2][1] * v[1] + rotation[2][2] * v[2] + translation[2]);
203 p[0] = v[0] - translation[0];
204 p[1] = v[1] - translation[1];
205 p[2] = v[2] - translation[2];
207 return Point3(rotation[0][0] * p[0] + rotation[1][0] * p[1] + rotation[2][0] * p[2],
208 rotation[0][1] * p[0] + rotation[1][1] * p[1] + rotation[2][1] * p[2],
209 rotation[0][2] * p[0] + rotation[1][2] * p[1] + rotation[2][2] * p[2]);
317 return -rotation.
column(2);
325 return rotation.
column(1);
329 return rotation.
column(0);
337 return -rotation.
column(0);
352 typedef CoordinateFrame
CFrame;
CoordinateFrame(const CoordinateFrame &other)
Definition: CoordinateFrame.h:130
std::string toXML() const
Definition: CoordinateFrame.cpp:200
float x
Definition: Vector3.h:62
Vector3 upVector() const
Definition: CoordinateFrame.h:324
CoordinateFrame lerp(const CoordinateFrame &other, float alpha) const
Definition: CoordinateFrame.cpp:419
CoordinateFrame toObjectSpace(const CoordinateFrame &c) const
Definition: CoordinateFrame.h:176
bool isIdentity() const
Definition: CoordinateFrame.cpp:188
static CoordinateFrame fromXYZYPRDegrees(float x, float y, float z, float yaw=0.0f, float pitch=0.0f, float roll=0.0f)
Definition: CoordinateFrame.cpp:142
bool operator!=(const CoordinateFrame &other) const
Definition: CoordinateFrame.h:84
Vector3 rightVector() const
Definition: CoordinateFrame.h:328
float w
Definition: Vector4.h:74
A rigid body RT (rotation-translation) transformation.
Definition: CoordinateFrame.h:59
~CoordinateFrame()
Definition: CoordinateFrame.h:143
class CoordinateFrame CFrame
Definition: Box2D.h:22
Dynamic 1D array tuned for performance.
Definition: Array.h:95
bool any(float x)
Definition: g3dmath.h:424
bool fuzzyIsIdentity() const
Definition: CoordinateFrame.cpp:170
Matrix3 rotation
Definition: CoordinateFrame.h:63
Vector4 toObjectSpace(const Vector4 &v) const
Definition: CoordinateFrame.h:180
bool operator==(const CoordinateFrame &other) const
Definition: CoordinateFrame.h:80
void getXYZYPRRadians(float &x, float &y, float &z, float &yaw, float &pitch, float &roll) const
Definition: CoordinateFrame.cpp:123
An arbitrary (oriented) 3D box, useful as a bounding box.
Definition: Box.h:35
float x
Definition: Vector4.h:74
Vector3 leftVector() const
Definition: CoordinateFrame.h:336
CoordinateFrame(const Matrix3 &rotation)
Definition: CoordinateFrame.h:107
void moveTowards(const CoordinateFrame &goal, float maxTranslation, float maxRotation)
Definition: CoordinateFrame.cpp:411
CoordinateFrame operator+(const Vector3 &v) const
Definition: CoordinateFrame.h:286
Easy loading and saving of human-readable configuration files.
Definition: Any.h:184
class Ray lookRay() const
Definition: CoordinateFrame.cpp:148
float getHeading() const
Definition: CoordinateFrame.h:166
void lookAt(const Point3 &target)
Definition: CoordinateFrame.cpp:377
CoordinateFrame()
Definition: CoordinateFrame.cpp:110
CoordinateFrame inverse() const
Definition: CoordinateFrame.h:136
#define debugAssert(exp)
Definition: debugAssert.h:160
Definition: Cylinder.h:27
G3D::int16 z
Definition: Vector3int16.h:46
Vector4 toWorldSpace(const Vector4 &v) const
Definition: CoordinateFrame.h:184
CoordinateFrame(const Matrix3 &rotation, const Point3 &translation)
Definition: CoordinateFrame.h:103
void deserialize(class BinaryInput &b)
Definition: CoordinateFrame.cpp:345
G3D::int16 y
Definition: Vector2int16.h:38
Vector3 lookVector() const
Definition: CoordinateFrame.h:316
CoordinateFrame(const Point3 &_translation)
Definition: CoordinateFrame.h:99
class Matrix4 toMatrix4() const
Definition: CoordinateFrame.cpp:195
float z
Definition: Vector4.h:74
Vector3 normalToObjectSpace(const Vector3 &v) const
Definition: CoordinateFrame.h:237
static void transpose(const Matrix3 &A, Matrix3 &out)
Definition: Matrix3.h:233
Vector3 vectorToObjectSpace(const Vector3 &v) const
Definition: CoordinateFrame.h:232
CoordinateFrame operator*(const CoordinateFrame &other) const
Definition: CoordinateFrame.h:281
Vector3 column(int c) const
Definition: Matrix3.cpp:203
float z
Definition: Vector3.h:62
std::string toXYZYPRDegreesString() const
Definition: CoordinateFrame.cpp:36
static unorm16 zero()
Definition: unorm16.h:82
Definition: BinaryOutput.h:52
void serialize(class BinaryOutput &b) const
Definition: CoordinateFrame.cpp:351
Any toAny() const
Definition: CoordinateFrame.cpp:87
static CoordinateFrame fromXYZYPRRadians(float x, float y, float z, float yaw=0.0f, float pitch=0.0f, float roll=0.0f)
Definition: CoordinateFrame.cpp:114
float y
Definition: Vector4.h:74
CoordinateFrame operator-(const Vector3 &v) const
Definition: CoordinateFrame.h:290
#define const
Definition: zconf.h:217
G3D::int16 x
Definition: Vector2int16.h:37
Coordinate frame expressed in Euler angles. Unlike a G3D::Quat, UprightFrame always keeps the referen...
Definition: UprightFrame.h:23
void getXYZYPRDegrees(float &x, float &y, float &z, float &yaw, float &pitch, float &roll) const
Definition: CoordinateFrame.cpp:133
Vector3 vectorToWorldSpace(const Vector3 &v) const
Definition: CoordinateFrame.h:215
bool fuzzyEq(const CoordinateFrame &other) const
Definition: CoordinateFrame.cpp:153
Vector3 Point3
Definition: Vector3.h:820
Definition: Triangle.h:34
Point3 pointToWorldSpace(const Point3 &v) const
Definition: CoordinateFrame.h:191
bool fuzzyEq(double a, double b)
Definition: g3dmath.h:857
float determinant() const
Definition: Matrix3.cpp:453
Point3 pointToObjectSpace(const Point3 &v) const
Definition: CoordinateFrame.h:201
Point3 translation
Definition: CoordinateFrame.h:66
Vector3 normalToWorldSpace(const Vector3 &v) const
Definition: CoordinateFrame.h:219