Class SoModelMatrixElement
- java.lang.Object
-
- com.openinventor.inventor.Inventor
-
- com.openinventor.inventor.elements.SoElement
-
- com.openinventor.inventor.elements.SoAccumulatedElement
-
- com.openinventor.inventor.elements.SoModelMatrixElement
-
- Direct Known Subclasses:
SoBBoxModelMatrixElement
,SoModelScaleElement
public class SoModelMatrixElement extends SoAccumulatedElement
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 fromSoAccumulatedElement
. Theset()
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.
- See Also:
SoMatrixTransform
,SoRotation
,SoRotationXYZ
,SoScale
,SoTransform
,SoTranslation
,SoUnits
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.openinventor.inventor.Inventor
Inventor.ConstructorCommand
-
-
Field Summary
-
Fields inherited from class com.openinventor.inventor.Inventor
VERBOSE_LEVEL, ZeroHandle
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static SbMatrix
get(SoState state)
Returns current model matrix from the state.static int
getClassStackIndex()
Deprecated.As of Open Inventor 9300.static SbMatrix
getCombinedCullMatrix(SoState state)
This method gets the model*cullMatrix combined matrix (which is cached by this element).static void
makeIdentity(SoState state, SoNode node)
Sets the model matrix to the identity matrix.static void
mult(SoState state, SoNode node, SbMatrix matrix)
Multiplies the given matrix into the model matrix.static void
popMatrix(SoState state, SbMatrix m)
This method is used by the TransformSeparator node.void
push(SoState state)
Overridespush()
method to copy values from next instance in the stack.static SbMatrix
pushMatrix(SoState state)
This method is used by the TransformSeparator node.static void
rotateBy(SoState state, SoNode node, SbRotation rotation)
This multiplies a matrix that performs the specified transformation into the model matrix.static void
scaleBy(SoState state, SoNode node, SbVec3f scaleFactor)
This multiplies a matrix that performs the specified transformation into the model matrix.static void
set(SoState state, SoNode node, SbMatrix matrix)
Calls set(state, node, matrix, true).static void
set(SoState state, SoNode node, SbMatrix matrix, boolean sendToGL)
Sets the model matrix to the given matrix.static void
setCullMatrix(SoState state, SoNode node, SbMatrix matrix)
Sets the transformation that defines the volume that view-volume culling should be tested against.static void
translateBy(SoState state, SoNode node, SbVec3f translation)
This multiplies a matrix that performs the specified transformation into the model matrix.-
Methods inherited from class com.openinventor.inventor.elements.SoElement
getClassStackIndex, pop
-
Methods inherited from class com.openinventor.inventor.Inventor
dispose, getNativeResourceHandle
-
-
-
-
Method Detail
-
set
public static void set(SoState state, SoNode node, SbMatrix matrix)
Calls set(state, node, matrix, true).
-
push
public void push(SoState state)
Overridespush()
method to copy values from next instance in the stack.- Overrides:
push
in classSoAccumulatedElement
-
popMatrix
public static void popMatrix(SoState state, SbMatrix m)
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.
-
getClassStackIndex
@Deprecated public static int getClassStackIndex()
Deprecated.As of Open Inventor 9300. replaced by SoElement.getClassStackIndex(Class)Returns the stack id for this element. ] *
-
scaleBy
public static void scaleBy(SoState state, SoNode node, SbVec3f scaleFactor)
This multiplies a matrix that performs the specified transformation into the model matrix.
-
rotateBy
public static void rotateBy(SoState state, SoNode node, SbRotation rotation)
This multiplies a matrix that performs the specified transformation into the model matrix.
-
pushMatrix
public static SbMatrix pushMatrix(SoState state)
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.
-
setCullMatrix
public static void setCullMatrix(SoState state, SoNode node, SbMatrix matrix)
Sets the transformation that defines the volume that view-volume culling should be tested against.
-
getCombinedCullMatrix
public static SbMatrix getCombinedCullMatrix(SoState state)
This method gets the model*cullMatrix combined matrix (which is cached by this element).
-
set
public static void set(SoState state, SoNode node, SbMatrix matrix, boolean sendToGL)
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.
-
makeIdentity
public static void makeIdentity(SoState state, SoNode node)
Sets the model matrix to the identity matrix.
-
translateBy
public static void translateBy(SoState state, SoNode node, SbVec3f translation)
This multiplies a matrix that performs the specified transformation into the model matrix.
-
-