csReversibleTransform Class Reference
[Geometry utilities]
A class which defines a reversible transformation from one coordinate system to another by maintaining an inverse transformation matrix.
More...
#include <csgeom/transfrm.h>
Inheritance diagram for csReversibleTransform:

Public Member Functions | |
csReversibleTransform () | |
Initialize with the identity transformation. | |
csReversibleTransform (const csMatrix3 &o2t, const csVector3 &pos) | |
Initialize with the given transformation. | |
csReversibleTransform (const csTransform &t) | |
Initialize with the given transformation. | |
csReversibleTransform (const csReversibleTransform &t) | |
Initialize with the given transformation. | |
const csMatrix3 & | GetT2O () const |
Get 'this' to 'other' transformation matrix. | |
csVector3 | GetT2OTranslation () const |
Get 'this' to 'other' translation. | |
csReversibleTransform | GetInverse () const |
Get the inverse of this transform. | |
virtual void | SetO2T (const csMatrix3 &m) |
Set 'other' to 'this' transformation matrix. | |
virtual void | SetT2O (const csMatrix3 &m) |
Set 'this' to 'other' transformation matrix. | |
csVector3 | This2Other (const csVector3 &v) const |
Convert vector v in 'this' space to 'other' space. | |
csVector3 | This2OtherRelative (const csVector3 &v) const |
Convert vector v in 'this' space to a vector in 'other' space, relative to local origin. | |
csPlane3 | This2Other (const csPlane3 &p) const |
Convert a plane in 'this' space to 'other' space. | |
csPlane3 | This2OtherRelative (const csPlane3 &p) const |
Convert a plane in 'this' space to 'other' space. | |
void | This2Other (const csPlane3 &p, const csVector3 &point, csPlane3 &result) const |
Convert a plane in 'this' space to 'other' space. | |
csSphere | This2Other (const csSphere &s) const |
Convert a sphere in 'this' space to 'other' space. | |
void | RotateOther (const csVector3 &v, float angle) |
Rotate the transform by the angle (radians) around the given vector, in other coordinates. | |
void | RotateThis (const csVector3 &v, float angle) |
Rotate the transform by the angle (radians) around the given vector, in these coordinates. | |
void | RotateOther (const csMatrix3 &m) |
Use the given transformation matrix, in other space, to reorient the transformation. | |
void | RotateThis (const csMatrix3 &m) |
Use the given transformation matrix, in this space, to reorient the transformation. | |
void | LookAt (const csVector3 &v, const csVector3 &up) |
Let this transform look at the given (x,y,z) point, using up as the up-vector. | |
Protected Member Functions | |
csReversibleTransform (const csMatrix3 &o2t, const csMatrix3 &t2o, const csVector3 &pos) | |
Initialize transform with both transform matrix and inverse tranform. | |
Protected Attributes | |
csMatrix3 | m_t2o |
Inverse transformation matrix ('this' to 'other' space). | |
Friends | |
csVector3 | operator/ (const csVector3 &v, const csReversibleTransform &t) |
Reverse a transformation on a 3D vector. | |
csVector3 & | operator/= (csVector3 &v, const csReversibleTransform &t) |
Reverse a transformation on a 3D vector. | |
csPlane3 | operator/ (const csPlane3 &p, const csReversibleTransform &t) |
Reverse a transformation on a Plane. | |
csPlane3 & | operator/= (csPlane3 &p, const csReversibleTransform &t) |
Reverse a transformation on a Plane. | |
csSphere | operator/ (const csSphere &p, const csReversibleTransform &t) |
Reverse a transformation on a sphere. | |
csReversibleTransform & | operator *= (csReversibleTransform &t1, const csReversibleTransform &t2) |
Combine two transforms, rightmost first. | |
csReversibleTransform | operator * (const csReversibleTransform &t1, const csReversibleTransform &t2) |
Combine two transforms, rightmost first. | |
csTransform | operator * (const csTransform &t1, const csReversibleTransform &t2) |
Combine two transforms, rightmost first. | |
csReversibleTransform & | operator/= (csReversibleTransform &t1, const csReversibleTransform &t2) |
Combine two transforms, reversing t2 then applying t1. | |
csReversibleTransform | operator/ (const csReversibleTransform &t1, const csReversibleTransform &t2) |
Combine two transforms, reversing t2 then applying t1. |
Detailed Description
A class which defines a reversible transformation from one coordinate system to another by maintaining an inverse transformation matrix.This version is similar to csTransform (in fact, it is a sub-class) but it is more efficient if you plan to do inverse transformations often.
Definition at line 303 of file transfrm.h.
Constructor & Destructor Documentation
|
Initialize transform with both transform matrix and inverse tranform.
Definition at line 312 of file transfrm.h. |
|
Initialize with the identity transformation.
Definition at line 319 of file transfrm.h. |
|
Initialize with the given transformation. The transformation is given as a 3x3 matrix and a vector. The transformation is defined to mean T=M*(O-V) with T the vector in 'this' space, O the vector in 'other' space, M the transformation matrix and V the transformation vector. Definition at line 328 of file transfrm.h. |
|
Initialize with the given transformation.
Definition at line 334 of file transfrm.h. |
|
Initialize with the given transformation.
Definition at line 340 of file transfrm.h. References m_t2o. |
Member Function Documentation
|
Get the inverse of this transform.
Definition at line 358 of file transfrm.h. |
|
Get 'this' to 'other' transformation matrix. This corresponds to the inverse of M. Definition at line 347 of file transfrm.h. |
|
Get 'this' to 'other' translation. This will calculate and return -(M*V). Definition at line 353 of file transfrm.h. |
|
Let this transform look at the given (x,y,z) point, using up as the up-vector. 'v' should be given relative to the position of the origin of this transform. For example, if the transform is located at pos=(3,1,9) and you want it to look at location loc=(10,2,8) while keeping the orientation so that the up-vector is upwards then you can use: LookAt (loc-pos, csVector3 (0, 1, 0)). |
|
Use the given transformation matrix, in other space, to reorient the transformation. Note: this function rotates the transformation, not the coordinate system. This basically calculates Minv=m*Minv (with Minv the inverse of M). M will be calculated accordingly. Definition at line 445 of file transfrm.h. |
|
Rotate the transform by the angle (radians) around the given vector, in other coordinates. Note: this function rotates the transform, not the coordinate system. |
|
Use the given transformation matrix, in this space, to reorient the transformation. Note: this function rotates the transformation, not the coordinate system. This basically calculates Minv=Minv*m (with Minv the inverse of M). M will be calculated accordingly. Definition at line 454 of file transfrm.h. |
|
Rotate the transform by the angle (radians) around the given vector, in these coordinates. Note: this function rotates the tranform, not the coordinate system. |
|
Set 'other' to 'this' transformation matrix. This is the 3x3 matrix M from the transform equation T=M*(O-V). Reimplemented from csTransform. Reimplemented in csOrthoTransform. Definition at line 365 of file transfrm.h. References csMatrix3::GetInverse(). |
|
Set 'this' to 'other' transformation matrix. This is equivalent to SetO2T() except that you can now give the inverse matrix. Reimplemented in csOrthoTransform. Definition at line 373 of file transfrm.h. References csMatrix3::GetInverse(). |
|
Convert a sphere in 'this' space to 'other' space.
|
|
Convert a plane in 'this' space to 'other' space. This is an optimized version for which a point on the new plane is known (point). The result is stored in 'result'. If 'p' is expressed as (N,D) (with N a vector for the A,B,C components of 'p') then this will return a new plane which looks like (Minv*N,-(Minv*N)*point) (with Minv the inverse of M). |
|
Convert a plane in 'this' space to 'other' space. If 'p' is expressed as (N,D) (with N a vector for the A,B,C components of 'p') then this will return a new plane which looks like (Minv*N,D-N*(M*V)) (with Minv the inverse of M). |
|
Convert vector v in 'this' space to 'other' space. This is the basic inverse transform operation and it corresponds with the calculation of V+Minv*v (with Minv the inverse of M). Definition at line 381 of file transfrm.h. |
|
Convert a plane in 'this' space to 'other' space. This version ignores translation. If 'p' is expressed as (N,D) (with N a vector for the A,B,C components of 'p') then this will return a new plane which looks like (Minv*N,D) (with Minv the inverse of M). |
|
Convert vector v in 'this' space to a vector in 'other' space, relative to local origin. This calculates and returns Minv*v (with Minv the inverse of M). Definition at line 389 of file transfrm.h. |
Friends And Related Function Documentation
|
Combine two transforms, rightmost first. Given the following definitions:
Reimplemented from csTransform. |
|
Combine two transforms, rightmost first. Given the following definitions:
Definition at line 535 of file transfrm.h. |
|
Combine two transforms, rightmost first. Given the following definitions:
Definition at line 513 of file transfrm.h. |
|
Combine two transforms, reversing t2 then applying t1. Given the following definitions:
|
|
Reverse a transformation on a sphere. This corresponds exactly to calling t.This2Other(p). |
|
Reverse a transformation on a Plane. This corresponds exactly to calling t.This2Other(p). |
|
Reverse a transformation on a 3D vector. This corresponds exactly to calling t.This2Other(v). |
|
Combine two transforms, reversing t2 then applying t1. Given the following definitions:
|
|
Reverse a transformation on a Plane. This corresponds exactly to calling p = t.This2Other(p). |
|
Reverse a transformation on a 3D vector. This corresponds exactly to calling v=t.This2Other(v). |
Member Data Documentation
|
Inverse transformation matrix ('this' to 'other' space).
Definition at line 307 of file transfrm.h. Referenced by csReversibleTransform(). |
The documentation for this class was generated from the following file:
- csgeom/transfrm.h
Generated for Crystal Space by doxygen 1.3.9.1