Visualization Library

A lightweight C++ OpenGL middleware for 2D/3D graphics
[Home] [Tutorials] [All Classes] [Grouped Classes]
Public Member Functions

vl::Transform Class Reference

Implements a 4x4 matrix transform used to define the position and orientation of an Actor. More...

#include <Transform.hpp>

Inheritance diagram for vl::Transform:
vl::TransformHierarchy< Transform > vl::ITransform vl::Object vl::Billboard

List of all members.

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() ).

Detailed Description

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.

Optimizing Your Transforms
See also:
setLocalAndWorldMatrix(), setAssumeIdentityWorldMatrix(), Rendering::transform()
Actor, Rendering, Effect, Renderable, Geometry

Definition at line 383 of file Transform.hpp.


Constructor & Destructor Documentation

vl::Transform::Transform (  ) [inline]

Constructor.

Definition at line 389 of file Transform.hpp.

References VL_DEBUG_SET_OBJECT_NAME.

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.


Member Function Documentation

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.

void Transform::translate ( Real  x,
Real  y,
Real  z 
)

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().

void Transform::scale ( Real  x,
Real  y,
Real  z 
)

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().

void Transform::rotate ( Real  degrees,
Real  x,
Real  y,
Real  z 
)

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().

void Transform::rotate ( const vec3 from,
const vec3 to 
)

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().


The documentation for this class was generated from the following files:

Visualization Library v2011.05.1142 Reference Documentation
Copyright 2005-2011 Michele Bosi. All rights reserved.
Updated on Thu May 26 2011 22:51:36.
Permission is granted to use this page to write and publish articles regarding Visualization Library.