Package com.openinventor.inventor.nodes
Class SoTransform
- java.lang.Object
-
- All Implemented Interfaces:
SafeDisposable
- Direct Known Subclasses:
SoTransformManip
public class SoTransform extends SoTransformation
General 3D geometric transformation node. This node defines a geometric 3D transformation consisting of (in order) a (possibly) non-uniform scale about an arbitrary point, a rotation about an arbitrary point and axis, and a translation. (While the transformations can be thought of as being applied in that order, matrices are actually premultiplied in the opposite order. Therefore, the operations are listed in the reverse order throughout this reference page.)File format/default:
Transform {
translation 0 0 0 rotation 0 0 1 0 scaleFactor 1 1 1 scaleOrientation 0 0 1 0 center 0 0 0 Action behavior:
SoGLRenderAction
,SoCallbackAction
,SoGetBoundingBoxAction
,SoRayPickAction
Accumulates transformation into the current transformation. Sets:SoModelMatrixElement
SoGetMatrixAction
Returns the matrix corresponding to the total transformation.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.openinventor.inventor.nodes.SoNode
SoNode.RenderModes
-
Nested classes/interfaces inherited from class com.openinventor.inventor.Inventor
Inventor.ConstructorCommand
-
-
Field Summary
Fields Modifier and Type Field Description SoSFVec3f
center
Origin for scale and rotation.SoSFRotation
rotation
Rotation specification.SoSFVec3f
scaleFactor
Scale factors.SoSFRotation
scaleOrientation
Rotational orientation for scale.SoSFVec3f
translation
Translation vector.-
Fields inherited from class com.openinventor.inventor.Inventor
VERBOSE_LEVEL, ZeroHandle
-
-
Constructor Summary
Constructors Constructor Description SoTransform()
Creates a transformation node with default settings.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
combineLeft(SoTransformation nodeOnLeft)
Convenience function that combines the effects of another transformation node into the current transformation stored in this node.void
combineRight(SoTransformation nodeOnRight)
Convenience function that combines the effects of another transformation node into the current transformation stored in this node.SbMatrix[]
getRotationSpaceMatrix()
Returns composite matrix that transforms from object space to rotation space (the space after the scale and rotation).SbMatrix[]
getScaleSpaceMatrix()
Returns composite matrix that transforms from object space to scale space (the space after the scale).SbMatrix[]
getTranslationSpaceMatrix()
Returns composite matrix that transforms from object space to translation space (the space after scale, rotation, and translation).void
multLeft(SbMatrix mat)
Convenience function that combines the effects of a matrix transformation into the current transformation stored in this node.void
multRight(SbMatrix mat)
Convenience function that combines the effects of a matrix transformation into the current transformation stored in this node.void
pointAt(SbVec3f fromPoint, SbVec3f toPoint)
Sets the node to translate the origin to the fromPoint and rotate the negative z-axis (0,0,-1) to lie on the vector from fromPoint to toPoint .void
recenter(SbVec3f newCenter)
Changes the center of the transformation to the given point without affecting the overall effect of the transformation.void
setMatrix(SbMatrix mat)
Sets the fields in the node to implement the transformation represented by the given matrix.-
Methods inherited from class com.openinventor.inventor.nodes.SoNode
affectsState, callback, copy, copy, distribute, doAction, getAlternateRep, getBoundingBox, getByName, getMatrix, getPrimitiveCount, getRenderEngineMode, getRenderUnitID, GLRender, GLRenderBelowPath, GLRenderInPath, GLRenderOffPath, grabEventsCleanup, grabEventsSetup, handleEvent, isBoundingBoxIgnoring, isOverride, pick, rayPick, search, setOverride, touch, write
-
Methods inherited from class com.openinventor.inventor.fields.SoFieldContainer
copyFieldValues, copyFieldValues, enableNotify, fieldsAreEqual, get, getAllFields, getEventIn, getEventOut, getField, getFieldName, hasDefaultValues, isNotifyEnabled, set, setToDefaults
-
Methods inherited from class com.openinventor.inventor.misc.SoBase
dispose, getName, isDisposable, isSynchronizable, setName, setSynchronizable
-
Methods inherited from class com.openinventor.inventor.Inventor
getNativeResourceHandle
-
-
-
-
Field Detail
-
translation
public final SoSFVec3f translation
Translation vector.
-
rotation
public final SoSFRotation rotation
Rotation specification.
-
scaleFactor
public final SoSFVec3f scaleFactor
Scale factors. Non-positive values may cause undesirable results.
-
scaleOrientation
public final SoSFRotation scaleOrientation
Rotational orientation for scale.
-
center
public final SoSFVec3f center
Origin for scale and rotation.
-
-
Method Detail
-
multLeft
public void multLeft(SbMatrix mat)
Convenience function that combines the effects of a matrix transformation into the current transformation stored in this node. This method premultiplies the transformation.
-
getTranslationSpaceMatrix
public SbMatrix[] getTranslationSpaceMatrix()
Returns composite matrix that transforms from object space to translation space (the space after scale, rotation, and translation).
-
pointAt
public void pointAt(SbVec3f fromPoint, SbVec3f toPoint)
Sets the node to translate the origin to the fromPoint and rotate the negative z-axis (0,0,-1) to lie on the vector from fromPoint to toPoint . This always tries to keep the "up" direction the positive y-axis, unless that is impossible. All current field values in the node are replaced.
-
setMatrix
public void setMatrix(SbMatrix mat)
Sets the fields in the node to implement the transformation represented by the given matrix. Note that invalid matrices (such as singular ones) have undefined results.
-
getScaleSpaceMatrix
public SbMatrix[] getScaleSpaceMatrix()
Returns composite matrix that transforms from object space to scale space (the space after the scale).
-
combineRight
public void combineRight(SoTransformation nodeOnRight)
Convenience function that combines the effects of another transformation node into the current transformation stored in this node. This method postmultiplies the transformation.
-
multRight
public void multRight(SbMatrix mat)
Convenience function that combines the effects of a matrix transformation into the current transformation stored in this node. This method postmultiplies the transformation.
-
combineLeft
public void combineLeft(SoTransformation nodeOnLeft)
Convenience function that combines the effects of another transformation node into the current transformation stored in this node. This method premultiplies the transformation.
-
recenter
public void recenter(SbVec3f newCenter)
Changes the center of the transformation to the given point without affecting the overall effect of the transformation.
-
getRotationSpaceMatrix
public SbMatrix[] getRotationSpaceMatrix()
Returns composite matrix that transforms from object space to rotation space (the space after the scale and rotation).
-
-