Class SoAntiSquish

All Implemented Interfaces:
SafeDisposable

public class SoAntiSquish extends SoTransformation
Transformation node that undoes non-uniform 3D scales. This node removes nonuniform 3D scaling from the current transformation matrix when traversed by an action. It is used by draggers such as the SoTrackballDragger that need to stay uniformly scaled no matter where they are located in the scene graph.

The magnitude of the new scale is determined by the current transformation matrix and the sizing field. This node does not change the translation or rotation in the matrix.

File format/default:

AntiSquish {

    sizing AVERAGE_DIMENSION
    recalcAlways true
}

Action behavior:

SoGLRenderAction, SoCallbackAction, SoGetBoundingBoxAction, SoGetMatrixAction, SoRayPickAction
Appends the current transformation with a new matrix to create an unsquished result.

See Also:
  • Field Details

    • sizing

      public final SoSFEnum<SoAntiSquish.Sizings> sizing
      Determines which of the algorithms enumerated by the type Sizing will be used to select the new scale when the x,y, and z scales are not equal. . Default is AVERAGE_DIMENSION.
    • recalcAlways

      public final SoSFBool recalcAlways
      If recalcAlways is true, this node calculates its unsquishing matrix every time it is traversed. If false, then this only occurs during the first traversal folllowing a call to recalc(). Default is true.
  • Constructor Details

    • SoAntiSquish

      public SoAntiSquish()
      Creates an anti-squish node with default settings.
  • Method Details

    • recalc

      public void recalc()
      Sets a flag so that the next time the node is traversed, it will recalculate its unsquishing matrix.