Stores the current model matrix. More...
#include <Inventor/elements/SoModelMatrixElement.h>
Classes | |
struct | Flags |
Public Member Functions | |
virtual void | push (SoState *state) |
virtual void | print (FILE *fp) const |
Static Public Member Functions | |
static SoType | getClassTypeId () |
static int | getClassStackIndex () |
static void | makeIdentity (SoState *state, SoNode *node) |
static void | set (SoState *state, SoNode *node, const SbMatrix &matrix, SbBool sendToGL=TRUE) |
static void | mult (SoState *state, SoNode *node, const SbMatrix &matrix) |
static void | translateBy (SoState *state, SoNode *node, const SbVec3f &translation) |
static void | rotateBy (SoState *state, SoNode *node, const SbRotation &rotation) |
static void | scaleBy (SoState *state, SoNode *node, const SbVec3f &scaleFactor) |
static SbMatrix | pushMatrix (SoState *state) |
static void | popMatrix (SoState *state, const SbMatrix &m) |
static void | setCullMatrix (SoState *state, SoNode *node, const SbMatrix &matrix) |
static const SbMatrix & | getCombinedCullMatrix (SoState *state) |
static const SbMatrix & | get (SoState *state) |
static const SbMatrix & | get (SoState *state, SbBool &isIdent) |
Friends | |
class | SoLocalBBoxMatrixElement |
Stores the current model matrix.
This element stores the current model matrix - the cumulative transformation applied to subsequent shapes. Because the matrix is cumulative, this class is derived from SoAccumulatedElement. The set() method replaces the current matrix, while all the others (mult(), translateBy(), etc.) multiply into it. Node id's of the nodes that affect the element are accumulated properly.
This element also stores the current view-volume culling transformation, which is normally the view*projection matrices (set by cameras), but which may be modified by sophisticated culling schemes.
SoMatrixTransform, SoRotation, SoRotationXYZ, SoScale, SoTransform, SoTranslation, SoUnits
Returns current model matrix from the state, sets given flag to TRUE if matrix is known to be identity.
Returns current model matrix from the state.
static int SoModelMatrixElement::getClassStackIndex | ( | ) | [static] |
Returns the stack id for this element.
Reimplemented from SoAccumulatedElement.
Reimplemented in SoBBoxModelMatrixElement, and SoModelScaleElement.
static SoType SoModelMatrixElement::getClassTypeId | ( | ) | [static] |
Returns the type identifier for this class.
Reimplemented from SoAccumulatedElement.
Reimplemented in SoBBoxModelMatrixElement, and SoModelScaleElement.
This method gets the model*cullMatrix combined matrix (which is cached by this element).
Sets the model matrix to the identity matrix.
static void SoModelMatrixElement::mult | ( | SoState * | state, | |
SoNode * | node, | |||
const SbMatrix & | matrix | |||
) | [static] |
Multiplies the given matrix into the model matrix.
This method is used by the TransformSeparator node.
WARNING! For proper caching behavior, the matrix returned by pushMatrix() must be used ONLY as a later argument to popMatrix(), and you must NOT modify the matrix between the push and the pop. If you need the matrix for any other reason, you MUST use the get() routine.
virtual void SoModelMatrixElement::print | ( | FILE * | fp | ) | const [virtual] |
Prints element (for debugging).
Reimplemented from SoAccumulatedElement.
virtual void SoModelMatrixElement::push | ( | SoState * | state | ) | [virtual] |
Overrides push() method to copy values from next instance in the stack.
Reimplemented from SoAccumulatedElement.
Reimplemented in SoBBoxModelMatrixElement.
This method is used by the TransformSeparator node.
WARNING! For proper caching behavior, the matrix returned by pushMatrix() must be used ONLY as a later argument to popMatrix(), and you must NOT modify the matrix between the push and the pop. If you need the matrix for any other reason, you MUST use the get() routine.
static void SoModelMatrixElement::rotateBy | ( | SoState * | state, | |
SoNode * | node, | |||
const SbRotation & | rotation | |||
) | [static] |
This multiplies a matrix that performs the specified transformation into the model matrix.
static void SoModelMatrixElement::scaleBy | ( | SoState * | state, | |
SoNode * | node, | |||
const SbVec3f & | scaleFactor | |||
) | [static] |
This multiplies a matrix that performs the specified transformation into the model matrix.
static void SoModelMatrixElement::set | ( | SoState * | state, | |
SoNode * | node, | |||
const SbMatrix & | matrix, | |||
SbBool | sendToGL = TRUE | |||
) | [static] |
Sets the model matrix to the given matrix.
This method will (indirectly) call glLoadMatrix with the new matrix unless the 'sendToGL' parameter is explicitly FALSE.
static void SoModelMatrixElement::setCullMatrix | ( | SoState * | state, | |
SoNode * | node, | |||
const SbMatrix & | matrix | |||
) | [static] |
Sets the transformation that defines the volume that view-volume culling should be tested against.
static void SoModelMatrixElement::translateBy | ( | SoState * | state, | |
SoNode * | node, | |||
const SbVec3f & | translation | |||
) | [static] |
This multiplies a matrix that performs the specified transformation into the model matrix.
friend class SoLocalBBoxMatrixElement [friend] |