Visualization LibraryA lightweight C++ OpenGL middleware for 2D/3D graphics |
[Home] [Tutorials] [All Classes] [Grouped Classes] |
Implements a 4x4 matrix transform used to define the position and orientation of an Actor. More...
#include <Transform.hpp>
Public Member Functions | |
| virtual const char * | className () |
| Returns the name of the class. | |
| Transform () | |
| Constructor. | |
| Transform (const mat4 &matrix) | |
| Constructor. | |
| void | setLocalAndWorldMatrix (const mat4 &matrix) |
| Sets both the local and the world matrices. | |
| void | translate (Real x, Real y, Real z) |
Utility function equivalent to setLocalMatrix( mat4::getTranslation(x,y,z)*localMatrix() ). | |
| void | translate (const vec3 &t) |
Utility function equivalent to setLocalMatrix( mat4::getTranslation(t)*localMatrix() ). | |
| void | scale (Real x, Real y, Real z) |
Utility function equivalent to setLocalMatrix( mat4::getScaling(x,y,z)*localMatrix() ). | |
| void | rotate (Real degrees, Real x, Real y, Real z) |
Utility function equivalent to setLocalMatrix( mat4::getRotation(degrees,x,y,z)*localMatrix() ). | |
| void | rotate (const vec3 &from, const vec3 &to) |
Utility function equivalent to setLocalMatrix( mat4::getRotation(from,to)*localMatrix() ). | |
Implements a 4x4 matrix transform used to define the position and orientation of an Actor.
Transforms can be linked together to create a tree-like hierarchy.
vl::Actor::setTransform(NULL).setAssumeIdentityWorldMatrix(true). This will save unnecessary matrix multiplications since multiplying by an identity matrix has no effect.Definition at line 383 of file Transform.hpp.
| vl::Transform::Transform | ( | ) | [inline] |
| vl::Transform::Transform | ( | const mat4 & | matrix ) | [inline] |
Constructor.
The matrix parameter is used to set both the local and world matrix.
Definition at line 395 of file Transform.hpp.
References VL_DEBUG_SET_OBJECT_NAME.
| virtual const char* vl::Transform::className | ( | ) | [inline, virtual] |
Returns the name of the class.
Reimplemented from vl::Object.
Reimplemented in vl::Billboard.
Definition at line 386 of file Transform.hpp.
| void vl::Transform::setLocalAndWorldMatrix | ( | const mat4 & | matrix ) | [inline] |
Sets both the local and the world matrices.
This function is useful to quickly set those Transforms that do not have a parent, for which is equivalent to: setLocalMatrix(matrix); computeWorldMatrix(NULL);
Definition at line 405 of file Transform.hpp.
Utility function equivalent to setLocalMatrix( mat4::getTranslation(x,y,z)*localMatrix() ).
After calling this you might want to call computeWorldMatrix() or computeWorldMatrixRecursive().
Definition at line 44 of file Transform.cpp.
References vl::Matrix4< GLfloat >::getTranslation(), vl::ITransform::localMatrix(), and vl::ITransform::setLocalMatrix().
| void Transform::translate | ( | const vec3 & | t ) |
Utility function equivalent to setLocalMatrix( mat4::getTranslation(t)*localMatrix() ).
After calling this you might want to call computeWorldMatrix() or computeWorldMatrixRecursive().
Definition at line 49 of file Transform.cpp.
References vl::Matrix4< GLfloat >::getTranslation(), vl::ITransform::localMatrix(), and vl::ITransform::setLocalMatrix().
Utility function equivalent to setLocalMatrix( mat4::getScaling(x,y,z)*localMatrix() ).
After calling this you might want to call computeWorldMatrix() or computeWorldMatrixRecursive().
Definition at line 54 of file Transform.cpp.
References vl::Matrix4< GLfloat >::getScaling(), vl::ITransform::localMatrix(), and vl::ITransform::setLocalMatrix().
Utility function equivalent to setLocalMatrix( mat4::getRotation(degrees,x,y,z)*localMatrix() ).
After calling this you might want to call computeWorldMatrix() or computeWorldMatrixRecursive().
Definition at line 59 of file Transform.cpp.
References vl::Matrix4< GLfloat >::getRotation(), vl::ITransform::localMatrix(), and vl::ITransform::setLocalMatrix().
Utility function equivalent to setLocalMatrix( mat4::getRotation(from,to)*localMatrix() ).
After calling this you might want to call computeWorldMatrix() or computeWorldMatrixRecursive().
Definition at line 64 of file Transform.cpp.
References vl::Matrix4< GLfloat >::getRotation(), vl::ITransform::localMatrix(), and vl::ITransform::setLocalMatrix().