#include <TransformStack.h>
Collaboration diagram for nvutil::TransformStack:
Public Member Functions | |
TransformStack () | |
Default constructor. | |
NVSG_API const nvmath::Mat44f | getClipToModel (void) const |
Get the transformation from clip space to model space. | |
NVSG_API const nvmath::Mat44f & | getClipToView (void) const |
Get the transformtion from clip space to view space. | |
NVSG_API const nvmath::Mat44f | getModelToClip (void) const |
Get the transformtion from model space to clip space. | |
NVSG_API const nvmath::Mat44f | getModelToView (void) const |
Get the transformtion from model space to view space. | |
NVSG_API const nvmath::Mat44f & | getModelToWorld (void) const |
Get the transformtion from model space to world space. | |
NVSG_API const nvmath::Mat44f & | getViewToClip (void) const |
Get the transformtion from view space to clip space. | |
NVSG_API const nvmath::Mat44f | getViewToModel (void) const |
Get the transformtion from view space to model space. | |
NVSG_API const nvmath::Mat44f & | getViewToWorld (void) const |
Get the transformtion from view space to world space. | |
NVSG_API const nvmath::Mat44f & | getWorldToModel (void) const |
Get the transformtion from world space to model space. | |
NVSG_API const nvmath::Mat44f & | getWorldToView (void) const |
Get the transformtion from world space to view space. | |
NVSG_API size_t | getStackDepth (void) const |
Get the depth of the model <-> world transformation stack. | |
NVSG_API void | popModelToWorld (void) |
Pop the top element of the model <-> world transformation stack. | |
NVSG_API void | pushModelToWorld (const nvmath::Mat44f &modelWorld, const nvmath::Mat44f &worldModel) |
Push a new pair of matrices on the model <-> world transformation stack. | |
NVSG_API void | setViewToClip (const nvmath::Mat44f &viewClip, const nvmath::Mat44f &clipView) |
Set the pair of matrices for the view <-> clip transformation. | |
NVSG_API void | setWorldToView (const nvmath::Mat44f &worldView, const nvmath::Mat44f &viewWorld) |
Set the pair of matrices for the world <-> view transformation. |
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).
model <-> world <-> view <-> clip
|
Default constructor. Initializes the model <-> world transformation stacks. |
|
Get the transformation from clip space to model space.
|
|
Get the transformtion from clip space to view space.
|
|
Get the transformtion from model space to clip space.
|
|
Get the transformtion from model space to view space.
|
|
Get the transformtion from model space to world space.
|
|
Get the transformtion from view space to clip space.
|
|
Get the transformtion from view space to model space.
|
|
Get the transformtion from view space to world space.
|
|
Get the transformtion from world space to model space.
|
|
Get the transformtion from world space to view space.
|
|
Get the depth of the model <-> world transformation stack.
|
|
Pop the top element of the model <-> world transformation stack.
|
|
Push a new pair of matrices on the model <-> world transformation stack.
|
|
Set the pair of matrices for the view <-> clip transformation.
|
|
Set the pair of matrices for the world <-> view transformation.
|