|
World of Rigid Bodies (WoRB)
|
Establishes temporarily a GL transform from body-fixed into world frame. More...
#include <Utilities.h>
Public Member Functions | |
| GLTransform (const RigidBody &body, bool flattenHeight=false) | |
| Constructor; saves the current and establishes a new transformation. | |
| GLTransform (const double *matrix) | |
| Constructor; saves the current and establishes a new transformation. | |
| ~GLTransform () | |
| Destructor; restores the earlier transformation. | |
Establishes temporarily a GL transform from body-fixed into world frame.
Usage: usually in a statement-block, like:
{
GLTransform _( body ); ...code-here... }
Definition at line 210 of file Utilities.h.
| WoRB::GLTransform::GLTransform | ( | const RigidBody & | body, |
| bool | flattenHeight = false |
||
| ) | [inline] |
Constructor; saves the current and establishes a new transformation.
Definition at line 215 of file Utilities.h.
References WoRB::QTensor::GetGLTransform(), and WoRB::RigidBody::ToWorld.
{
// Get the OpenGL transformation for the rigid body
//
GLdouble mat[ 16 ];
body.ToWorld.GetGLTransform( mat );
glPushMatrix (); // Save the current transformation
if ( flattenHeight ) {
glScaled( 1.0, 0, 1.0 );
}
glMultMatrixd( mat ); // Transform from body-fixed into world frame
}
| WoRB::GLTransform::GLTransform | ( | const double * | matrix | ) | [inline] |
Constructor; saves the current and establishes a new transformation.
Definition at line 233 of file Utilities.h.
{
glPushMatrix (); // Save the current transformation
glMultMatrixd( matrix ); // Transform from body-fixed into world frame
}
| WoRB::GLTransform::~GLTransform | ( | ) | [inline] |
Destructor; restores the earlier transformation.
Definition at line 241 of file Utilities.h.
{
glPopMatrix ();
}