Class SoGetMatrixAction
When this action is applied to a node, it computes the matrix for just that node. This is currently the easiest way to get the transformation matrix for an SoTransform
node. It's not very useful for most other types of nodes.
The most common scenario is applying this action to a path. In that case it gathers the transformation info for all nodes in the path and those that affect nodes in the path, but it stops when it hits the last node in the path; it does
not traverse downwards from it as most other actions (such as rendering) do. This behavior makes the most sense for this action. To get a path to, for example, a specific geometry in the scene graph see SoSearchAction
.
Sets: SoViewportRegionElement
// Get cumulative matrix using current viewport on screen SoPath somePath = ... SoGetMatrixAction gma = new SoGetMatrixAction( viewer.getArea().getViewportRegion() ); gma.apply( somePath ); SbMatrix matrix = gma.getMatrix();
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class com.openinventor.inventor.actions.SoAction
SoAction.AppliedCodes, SoAction.DistribModes, SoAction.PathCodes, SoAction.PathIndices
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
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
enableElement
(Class<? extends Inventor> t, int stkIndex) Returns the inverse of the cumulative transformation matrix.Returns cumulative transformation matrix.Returns the inverse of the cumulative texture transformation matrix.Returns cumulative texture transformation matrix.Returns current viewport region to use for action.void
setViewportRegion
(SbViewportRegion newRegion) Sets current viewport region to use for action.Methods inherited from class com.openinventor.inventor.actions.SoAction
apply, apply, clearApplyResult, forwardTraversal, forwardTraversal, getContinueActionInBranchFlag, getCurPath, getDistribMode, getNodeAppliedTo, getOriginalPathListAppliedTo, getPathAppliedTo, getPathCode, getPathListAppliedTo, getPipeId, getSceneManager, getState, getWhatAppliedTo, hasTerminated, invalidateState, isBeingApplied, isLastPathListAppliedTo, isUsingAlternateRep, nullAction, postDelayedTraversal, preDelayedTraversal, resetContinueActionInBranchFlag, setPipeId, setSceneManager, setUpState, stopActionInBranch, traverse, useAlternateRep
Methods inherited from class com.openinventor.inventor.Inventor
dispose, getNativeResourceHandle
-
Constructor Details
-
SoGetMatrixAction
Constructor.
Even though the bounding box computation may not involve a window per se, some nodes need the size of the viewport to determine their size in 3D coordinates. For example the size of anSoText2
is a fixed value in device coordinates, but the corresponding size in 3D depends on the current camera.Usually it is convenient to get the actual viewport region from the viewer as shown in the example above. However if the scene graph does not contain any viewport dependent nodes then any values can be used.
-
-
Method Details
-
getInverse
Returns the inverse of the cumulative transformation matrix. Warning: the matrix returned by this routine should not be changed (unless you are implementing your own transformation nodes). -
getTextureInverse
Returns the inverse of the cumulative texture transformation matrix. Warning: the matrix returned by this routine should not be changed (unless you are implementing your own transformation nodes). -
getMatrix
Returns cumulative transformation matrix. Warning: the matrix returned by this routine should not be changed (unless you are implementing your own transformation nodes). -
getTextureMatrix
Returns cumulative texture transformation matrix. Warning: the matrix returned by this routine should not be changed (unless you are implementing your own transformation nodes). -
enableElement
-
setViewportRegion
Sets current viewport region to use for action. -
getViewportRegion
Returns current viewport region to use for action.
-