public class SoGetMatrixAction extends SoAction
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:
SoAction.AppliedCodes, SoAction.DistribModes, SoAction.PathCodes, SoAction.PathIndices
Inventor.ConstructorCommand
ALL, BELOW_PATH, CLUSTER_ONLY, IN_PATH, LOCAL_ONLY, NO_PATH, NODE, OFF_PATH, PATH, PATH_LIST
VERBOSE_LEVEL, ZeroHandle
Constructor and Description |
---|
SoGetMatrixAction(SbViewportRegion newRegion)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
static void |
enableElement(java.lang.Class<? extends Inventor> t,
int stkIndex) |
SbMatrix |
getInverse()
Returns the inverse of the cumulative transformation matrix.
|
SbMatrix |
getMatrix()
Returns cumulative transformation matrix.
|
SbMatrix |
getTextureInverse()
Returns the inverse of the cumulative texture transformation matrix.
|
SbMatrix |
getTextureMatrix()
Returns cumulative texture transformation matrix.
|
SbViewportRegion |
getViewportRegion()
Returns current viewport region to use for action.
|
void |
setViewportRegion(SbViewportRegion newRegion)
Sets current viewport region to use for action.
|
apply, apply, clearApplyResult, forwardTraversal, getContinueActionInBranchFlag, getCurPath, getNodeAppliedTo, getOriginalPathListAppliedTo, getPathAppliedTo, getPathCode, getPathListAppliedTo, getPipeId, getSceneManager, getState, getWhatAppliedTo, hasTerminated, invalidateState, isBeingApplied, isLastPathListAppliedTo, isUsingAlternateRep, nullAction, postDelayedTraversal, preDelayedTraversal, resetContinueActionInBranchFlag, setPipeId, setSceneManager, setUpState, stopActionInBranch, traverse, useAlternateRep
dispose, getAddress, getNativeResourceHandle, startInternalThreads, stopInternalThreads
public SoGetMatrixAction(SbViewportRegion newRegion)
SoText2
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.
public SbMatrix getTextureMatrix()
public SbViewportRegion getViewportRegion()
public SbMatrix getMatrix()
public SbMatrix getInverse()
public void setViewportRegion(SbViewportRegion newRegion)
public static void enableElement(java.lang.Class<? extends Inventor> t, int stkIndex)
public SbMatrix getTextureInverse()
Generated on January 23, 2025, Copyright © Thermo Fisher Scientific. All rights reserved. http://www.openinventor.com