Class SoLocalBBoxMatrixElement


  • public class SoLocalBBoxMatrixElement
    extends SoElement
    Stores the transformation matrix from object space to some local coordinate space during application of an SoGetBoundingBoxAction. This element stores the transformation matrix from object space to some local coordinate space during application of an SoGetBoundingBoxAction. This element is needed to allow separators (and other caching nodes) to store cached bounding boxes in their own local space. Shapes that extend the current bounding box computed by the action use this matrix to transform the bounding box into local space. Separators cache this box, then transform it into the next local space up the hierarchy.

    Because this element is set to identity by separators before traversing their children, it can never have an affect on any caching separator that it is not under. Therefore, it should never be tested for cache invalidation, so its matches() method prints an error message and returns false. It also means that it does not have to save node id's so there are no nodes passed in to any of the methods.

    • Method Detail

      • makeIdentity

        public static void makeIdentity​(SoState state)
        Sets the local matrix to the identity matrix.
      • set

        public static void set​(SoState state,
                               SbMatrix matrix)
        Sets the local matrix to the given matrix.
      • get

        public static SbMatrix get​(SoState state)
        Returns current matrix from the state.
      • resetAll

        public static void resetAll​(SoState state)
        Resets all current instances in the state to identity.
      • getClassStackIndex

        @Deprecated
        public static int getClassStackIndex()
        Deprecated.
        As of Open Inventor 9300. replaced by SoElement.getClassStackIndex(Class)
        Returns the stack id for this element. ] *
      • push

        public void push​(SoState state)
        Overrides push() method to copy values from next instance in the stack.
        Overrides:
        push in class SoElement
      • popMatrix

        public static void popMatrix​(SoState state,
                                     SbMatrix m)
        This method is used by the TransformSeparator node.
      • scaleBy

        public static void scaleBy​(SoState state,
                                   SbVec3f scaleFactor)
        Multiplies a matrix that performs the specified transformation into the local matrix.
      • pushMatrix

        public static SbMatrix pushMatrix​(SoState state)
        This method is used by the TransformSeparator node.
      • mult

        public static void mult​(SoState state,
                                SbMatrix matrix)
        Multiplies the given matrix into the local matrix.
      • translateBy

        public static void translateBy​(SoState state,
                                       SbVec3f translation)
        Multiplies a matrix that performs the specified transformation into the local matrix.
      • rotateBy

        public static void rotateBy​(SoState state,
                                    SbRotation rotation)
        Multiplies a matrix that performs the specified transformation into the local matrix.