Main Page   Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

nvutil::TransformStack Class Reference

Utility class to hold a stack of concatenated transformation matrices. More...

#include <TransformStack.h>

Collaboration diagram for nvutil::TransformStack:

Collaboration graph
[legend]
List of all members.

Public Methods

 TransformStack ()
 Default constructor. More...

NVSG_API const nvmath::Mat44f getClipToModel (void) const
 Get the transformation from clip space to model space. More...

NVSG_API const nvmath::Mat44fgetClipToView (void) const
 Get the transformtion from clip space to view space. More...

NVSG_API const nvmath::Mat44f getModelToClip (void) const
 Get the transformtion from model space to clip space. More...

NVSG_API const nvmath::Mat44f getModelToView (void) const
 Get the transformtion from model space to view space. More...

NVSG_API const nvmath::Mat44fgetModelToWorld (void) const
 Get the transformtion from model space to world space. More...

NVSG_API const nvmath::Mat44fgetViewToClip (void) const
 Get the transformtion from view space to clip space. More...

NVSG_API const nvmath::Mat44f getViewToModel (void) const
 Get the transformtion from view space to model space. More...

NVSG_API const nvmath::Mat44fgetViewToWorld (void) const
 Get the transformtion from view space to world space. More...

NVSG_API const nvmath::Mat44fgetWorldToModel (void) const
 Get the transformtion from world space to model space. More...

NVSG_API const nvmath::Mat44fgetWorldToView (void) const
 Get the transformtion from world space to view space. More...

NVSG_API size_t getStackDepth (void) const
 Get the depth of the model <-> world transformation stack. More...

NVSG_API void popModelToWorld (void)
 Pop the top element of the model <-> world transformation stack. More...

NVSG_API void pushModelToWorld (const nvmath::Mat44f &modelWorld, const nvmath::Mat44f &worldModel)
 Push a new pair of matrices on the model <-> world transformation stack. More...

NVSG_API void setViewToClip (const nvmath::Mat44f &viewClip, const nvmath::Mat44f &clipView)
 Set the pair of matrices for the view <-> clip transformation. More...

NVSG_API void setWorldToView (const nvmath::Mat44f &worldView, const nvmath::Mat44f &viewWorld)
 Set the pair of matrices for the world <-> view transformation. More...


Detailed Description

Utility class to hold a stack of concatenated transformation matrices.

This class makes it easy to maintain all steps of the transformation pipeline from model space via world space and view space to clip space (and vice versa).
Individiual objects are defined in an local coordinate system called model space. There is often a hierarchy of modeling coordinate systems that are maintained by this class by using popModelToWorld and pushModelToWorld.
Objects are then transformed into the world space.
The view space is used to define a view volume. This system is used so that, with the eye or camera at the origin looking toward -z, decreasing values of z are farther away from the eye, x is to the right and y is up.
From view space, we next go to the clip space, that is we're using the projection to get logical 2D device coordinates (In contrast to physical device coordinates, which additionally need the viewport information).

With these terms, the transformation pipeline looks like that:

   model <-> world <-> view <-> clip


Constructor & Destructor Documentation

nvutil::TransformStack::TransformStack   [inline]
 

Default constructor.

Initializes the model <-> world transformation stacks.


Member Function Documentation

const nvmath::Mat44f nvutil::TransformStack::getClipToModel void    const [inline]
 

Get the transformation from clip space to model space.

const nvmath::Mat44f & nvutil::TransformStack::getClipToView void    const [inline]
 

Get the transformtion from clip space to view space.

const nvmath::Mat44f nvutil::TransformStack::getModelToClip void    const [inline]
 

Get the transformtion from model space to clip space.

const nvmath::Mat44f nvutil::TransformStack::getModelToView void    const [inline]
 

Get the transformtion from model space to view space.

const nvmath::Mat44f & nvutil::TransformStack::getModelToWorld void    const [inline]
 

Get the transformtion from model space to world space.

const nvmath::Mat44f & nvutil::TransformStack::getViewToClip void    const [inline]
 

Get the transformtion from view space to clip space.

const nvmath::Mat44f nvutil::TransformStack::getViewToModel void    const [inline]
 

Get the transformtion from view space to model space.

const nvmath::Mat44f & nvutil::TransformStack::getViewToWorld void    const [inline]
 

Get the transformtion from view space to world space.

const nvmath::Mat44f & nvutil::TransformStack::getWorldToModel void    const [inline]
 

Get the transformtion from world space to model space.

const nvmath::Mat44f & nvutil::TransformStack::getWorldToView void    const [inline]
 

Get the transformtion from world space to view space.

size_t nvutil::TransformStack::getStackDepth void    const [inline]
 

Get the depth of the model <-> world transformation stack.

void nvutil::TransformStack::popModelToWorld void    [inline]
 

Pop the top element of the model <-> world transformation stack.

void nvutil::TransformStack::pushModelToWorld const nvmath::Mat44f   modelWorld,
const nvmath::Mat44f   worldModel
[inline]
 

Push a new pair of matrices on the model <-> world transformation stack.

Note:
modelWorld and worldModel should be inverse to each other to get correct results.
Parameters:
modelWorld  additional model to world transformation
worldModel  additional world to model transformation

void nvutil::TransformStack::setViewToClip const nvmath::Mat44f   viewClip,
const nvmath::Mat44f   clipView
[inline]
 

Set the pair of matrices for the view <-> clip transformation.

Note:
viewClip and clipView should be inverse to each other to get correct results.
Parameters:
viewClip  new view to clip transformation (projection)
clipView  new clip to view transformation

void nvutil::TransformStack::setWorldToView const nvmath::Mat44f   worldView,
const nvmath::Mat44f   viewWorld
[inline]
 

Set the pair of matrices for the world <-> view transformation.

Note:
worldView and viewWorld should be inverse to each other to get correct results.
Parameters:
worldView  new world to view transformation
viewWorld  new view to world transformation


The documentation for this class was generated from the following file:
Generated on Tue Mar 1 13:20:47 2005 for NVSGSDK by NVIDIA