G3D::CoordinateFrame Class ReferenceA rigid body RT (rotation-translation) transformation.
More...
#include <CoordinateFrame.h>
List of all members.
Detailed Description
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
Constructor & Destructor Documentation
| G3D::CoordinateFrame::CoordinateFrame |
( |
|
) |
[inline] |
Initializes to the identity coordinate frame.
| G3D::CoordinateFrame::CoordinateFrame |
( |
const Vector3 & |
_translation |
) |
[inline] |
| G3D::CoordinateFrame::CoordinateFrame |
( |
const Matrix3 & |
rotation, |
|
|
const Vector3 & |
translation | |
|
) |
| | [inline] |
| G3D::CoordinateFrame::CoordinateFrame |
( |
const Matrix3 & |
rotation |
) |
[inline] |
| G3D::CoordinateFrame::CoordinateFrame |
( |
class BinaryInput & |
b |
) |
|
| G3D::CoordinateFrame::CoordinateFrame |
( |
const CoordinateFrame & |
other |
) |
[inline] |
| G3D::CoordinateFrame::~CoordinateFrame |
( |
|
) |
[inline] |
Member Function Documentation
| void G3D::CoordinateFrame::deserialize |
( |
class BinaryInput & |
b |
) |
|
| bool G3D::CoordinateFrame::fuzzyIsIdentity |
( |
|
) |
const |
| float G3D::CoordinateFrame::getHeading |
( |
|
) |
const [inline] |
Returns the heading of the lookVector as an angle in radians relative to the world -z axis.
That is, a counter-clockwise heading where north (-z) is 0 and west (-x) is PI/2.
Note that the heading ignores the Y axis, so an inverted object has an inverted heading.
Computes the inverse of this coordinate frame.
| bool G3D::CoordinateFrame::isIdentity |
( |
|
) |
const |
| Vector3 G3D::CoordinateFrame::leftVector |
( |
|
) |
const [inline] |
If a viewer looks along the look vector, this is the viewer's "left".
Useful for strafing motions and building alternative coordinate frames.
Linearly interpolates between two coordinate frames, using Quat::slerp for the rotations.
| void G3D::CoordinateFrame::lookAt |
( |
const Vector3 & |
target, |
|
|
Vector3 |
up | |
|
) |
| | |
| void G3D::CoordinateFrame::lookAt |
( |
const Vector3 & |
target |
) |
|
| class Ray G3D::CoordinateFrame::lookRay |
( |
|
) |
const |
| Vector3 G3D::CoordinateFrame::lookVector |
( |
|
) |
const [inline] |
The direction this camera is looking (its negative z axis).
| Vector3 G3D::CoordinateFrame::normalToObjectSpace |
( |
const Vector3 & |
v |
) |
const [inline] |
| Vector3 G3D::CoordinateFrame::normalToWorldSpace |
( |
const Vector3 & |
v |
) |
const [inline] |
Compose: create the transformation that is other followed by this.
| bool G3D::CoordinateFrame::operator!= |
( |
const CoordinateFrame & |
other |
) |
const [inline] |
| bool G3D::CoordinateFrame::operator== |
( |
const CoordinateFrame & |
other |
) |
const [inline] |
| Vector3 G3D::CoordinateFrame::pointToObjectSpace |
( |
const Vector3 & |
v |
) |
const [inline] |
Transforms the point into object space.
| Vector3 G3D::CoordinateFrame::pointToWorldSpace |
( |
const Vector3 & |
v |
) |
const [inline] |
Transforms the point into world space.
| Vector3 G3D::CoordinateFrame::rightVector |
( |
|
) |
const [inline] |
| void G3D::CoordinateFrame::serialize |
( |
class BinaryOutput & |
b |
) |
const |
| class Matrix4 G3D::CoordinateFrame::toMatrix4 |
( |
|
) |
const |
| class Sphere G3D::CoordinateFrame::toObjectSpace |
( |
const Sphere & |
b |
) |
const |
| class Plane G3D::CoordinateFrame::toObjectSpace |
( |
const Plane & |
p |
) |
const |
| class Box G3D::CoordinateFrame::toObjectSpace |
( |
const Box & |
b |
) |
const |
| class Box G3D::CoordinateFrame::toObjectSpace |
( |
const AABox & |
b |
) |
const |
| class Ray G3D::CoordinateFrame::toObjectSpace |
( |
const Ray & |
r |
) |
const |
| Vector4 G3D::CoordinateFrame::toObjectSpace |
( |
const Vector4 & |
v |
) |
const [inline] |
Takes the coordinate frame into object space.
this->inverse() * c
| class Triangle G3D::CoordinateFrame::toWorldSpace |
( |
const class Triangle & |
t |
) |
const |
| class Sphere G3D::CoordinateFrame::toWorldSpace |
( |
const class Sphere & |
b |
) |
const |
| class Plane G3D::CoordinateFrame::toWorldSpace |
( |
const class Plane & |
p |
) |
const |
| class Capsule G3D::CoordinateFrame::toWorldSpace |
( |
const class Capsule & |
b |
) |
const |
| class Cylinder G3D::CoordinateFrame::toWorldSpace |
( |
const class Cylinder & |
b |
) |
const |
| class Box G3D::CoordinateFrame::toWorldSpace |
( |
const class Box & |
b |
) |
const |
| class Box G3D::CoordinateFrame::toWorldSpace |
( |
const class AABox & |
b |
) |
const |
| Ray G3D::CoordinateFrame::toWorldSpace |
( |
const Ray & |
r |
) |
const |
| Vector4 G3D::CoordinateFrame::toWorldSpace |
( |
const Vector4 & |
v |
) |
const [inline] |
| std::string G3D::CoordinateFrame::toXML |
( |
|
) |
const |
Produces an XML serialization of this coordinate frame.
| Vector3 G3D::CoordinateFrame::upVector |
( |
|
) |
const [inline] |
Up direction for this camera (its y axis).
| Vector3 G3D::CoordinateFrame::vectorToObjectSpace |
( |
const Vector3 & |
v |
) |
const [inline] |
Transforms the vector into object space (no translation).
| Vector3 G3D::CoordinateFrame::vectorToWorldSpace |
( |
const Vector3 & |
v |
) |
const [inline] |
Transforms the vector into world space (no translation).
Member Data Documentation
Takes object space points to world space.
Takes object space points to world space.
The documentation for this class was generated from the following file:
Generated on Thu Aug 2 11:40:45 2007 for G3D by
1.5.2
Hosted by
|