World of Rigid Bodies (WoRB)
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
WoRB::GLTransform Class Reference

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.

Detailed Description

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.


Constructor & Destructor Documentation

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
        }

Destructor; restores the earlier transformation.

Definition at line 241 of file Utilities.h.

        {
            glPopMatrix ();
        }

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