|
| CoordinateFrame (const Any &any) |
|
| CoordinateFrame () |
|
Initializes to the identity coordinate frame. More...
|
|
| CoordinateFrame (const Point3 &_translation) |
|
| CoordinateFrame (const Matrix3 &rotation, const Point3 &translation) |
|
| CoordinateFrame (const Matrix3 &rotation) |
|
| CoordinateFrame (const class UprightFrame &f) |
|
| CoordinateFrame (class BinaryInput &b) |
|
| CoordinateFrame (const CoordinateFrame &other) |
|
| ~CoordinateFrame () |
|
void | deserialize (class BinaryInput &b) |
|
bool | fuzzyEq (const CoordinateFrame &other) const |
|
bool | fuzzyIsIdentity () const |
|
float | getHeading () const |
|
Returns the heading of the lookVector as an angle in radians relative to the world -z axis. More...
|
|
void | getXYZYPRDegrees (float &x, float &y, float &z, float &yaw, float &pitch, float &roll) const |
|
void | getXYZYPRRadians (float &x, float &y, float &z, float &yaw, float &pitch, float &roll) const |
|
CoordinateFrame | inverse () const |
| Computes the inverse of this coordinate frame. More...
|
|
bool | isIdentity () const |
|
Vector3 | leftVector () const |
|
If a viewer looks along the look vector, this is the viewer's "left". More...
|
|
CoordinateFrame | lerp (const CoordinateFrame &other, float alpha) const |
|
Linearly interpolates between two coordinate frames, using Quat::slerp for the rotations. More...
|
|
void | lookAt (const Point3 &target) |
|
void | lookAt (const Point3 &target, Vector3 up) |
|
class Ray | lookRay () const |
| Returns the ray starting at the camera origin travelling in direction CoordinateFrame::lookVector. More...
|
|
Vector3 | lookVector () const |
| The direction this camera is looking (its negative z axis) More...
|
|
void | moveTowards (const CoordinateFrame &goal, float maxTranslation, float maxRotation) |
|
Transform this coordinate frame towards goal, but not past it, goverened by maximum rotation and translations. More...
|
|
Vector3 | normalToObjectSpace (const Vector3 &v) const |
|
void | normalToObjectSpace (const Array< Vector3 > &v, Array< Vector3 > &vout) const |
|
Vector3 | normalToWorldSpace (const Vector3 &v) const |
|
void | normalToWorldSpace (const Array< Vector3 > &v, Array< Vector3 > &vout) const |
|
bool | operator!= (const CoordinateFrame &other) const |
|
CoordinateFrame | operator* (const CoordinateFrame &other) const |
| Compose: create the transformation that is other followed by this. More...
|
|
CoordinateFrame | operator+ (const Vector3 &v) const |
|
CoordinateFrame | operator- (const Vector3 &v) const |
|
bool | operator== (const CoordinateFrame &other) const |
|
Point3 | pointToObjectSpace (const Point3 &v) const |
|
Transforms the point into object space. More...
|
|
void | pointToObjectSpace (const Array< Point3 > &v, Array< Point3 > &vout) const |
|
Point3 | pointToWorldSpace (const Point3 &v) const |
|
Transforms the point into world space. More...
|
|
void | pointToWorldSpace (const Array< Point3 > &v, Array< Point3 > &vout) const |
|
Vector3 | rightVector () const |
|
void | serialize (class BinaryOutput &b) const |
|
Any | toAny () const |
| Converts the CFrame to an Any. More...
|
|
class Matrix4 | toMatrix4 () const |
| See also Matrix4::approxCoordinateFrame. More...
|
|
CoordinateFrame | toObjectSpace (const CoordinateFrame &c) const |
|
Takes the coordinate frame into object space. More...
|
|
Vector4 | toObjectSpace (const Vector4 &v) const |
|
class Ray | toObjectSpace (const Ray &r) const |
|
class Plane | toObjectSpace (const Plane &p) const |
|
class Box | toObjectSpace (const AABox &b) const |
|
class Sphere | toObjectSpace (const Sphere &b) const |
|
class Box | toObjectSpace (const Box &b) const |
|
Triangle | toObjectSpace (const Triangle &t) const |
|
Vector4 | toWorldSpace (const Vector4 &v) const |
|
Ray | toWorldSpace (const Ray &r) const |
|
Frustum | toWorldSpace (const Frustum &f) const |
|
void | toWorldSpace (const class AABox &b, class AABox &result) const |
|
class Sphere | toWorldSpace (const class Sphere &b) const |
|
class Capsule | toWorldSpace (const class Capsule &b) const |
|
class Box | toWorldSpace (const class AABox &b) const |
|
class Cylinder | toWorldSpace (const class Cylinder &b) const |
|
class Triangle | toWorldSpace (const class Triangle &t) const |
|
class Plane | toWorldSpace (const class Plane &p) const |
|
class Box | toWorldSpace (const class Box &b) const |
|
String | toXML () const |
|
Produces an XML serialization of this coordinate frame. More...
|
|
String | toXYZYPRDegreesString () const |
|
Vector3 | upVector () const |
| Up direction for this camera (its y axis). More...
|
|
Vector3 | vectorToObjectSpace (const Vector3 &v) const |
|
Transforms the vector into object space (no translation). More...
|
|
void | vectorToObjectSpace (const Array< Vector3 > &v, Array< Vector3 > &vout) const |
|
Vector3 | vectorToWorldSpace (const Vector3 &v) const |
|
Transforms the vector into world space (no translation). More...
|
|
void | vectorToWorldSpace (const Array< Vector3 > &v, Array< Vector3 > &vout) const |
|
|
static CoordinateFrame | fromXAxis (const Vector3 &X, const Point3 &origin=Point3::zero()) |
| Uses G3D::Vector3::getTangents to compute a reference frame from a x-axis and optional origin. More...
|
|
static CoordinateFrame | fromXYZYPRDegrees (float x, float y, float z, float yaw=0.0f, float pitch=0.0f, float roll=0.0f) |
| Construct a coordinate frame from translation = (x,y,z) and rotations (in that order) about Y, object space X, object space Z. More...
|
|
static CoordinateFrame | fromXYZYPRRadians (float x, float y, float z, float yaw=0.0f, float pitch=0.0f, float roll=0.0f) |
|
static CoordinateFrame | fromYAxis (const Vector3 &Y, const Point3 &origin=Point3::zero()) |
| Uses G3D::Vector3::getTangents to compute a reference frame from a y-axis and optional origin. More...
|
|
static CoordinateFrame | fromZAxis (const Vector3 &Z, const Point3 &origin=Point3::zero()) |
| Uses G3D::Vector3::getTangents to compute a reference frame from a z-axis and optional origin. More...
|
|
A rigid body RT (rotation-translation) transformation.
CoordinateFrame abstracts a 4x4 matrix that maps object space to world space:
v_world = C * v_object
CoordinateFrame::rotation is the upper 3x3 submatrix, CoordinateFrame::translation is the right 3x1 column. The 4th row is always [0 0 0 1], so it isn't stored.
So you don't have to remember which way the multiplication and transformation work, it provides explicit toWorldSpace and toObjectSpace methods. Also, points, vectors (directions), and surface normals transform differently, so they have separate methods.
Some helper functions transform whole primitives like boxes in and out of object space.
Convert to Matrix4 using CoordinateFrame::toMatrix4. You can construct a CoordinateFrame from a Matrix4 using Matrix4::approxCoordinateFrame, however, because a Matrix4 is more general than a CoordinateFrame, some information may be lost.
- See also
- G3D::UprightFrame, G3D::PhysicsFrame, G3D::Matrix4, G3D::Quat