Class ColladaTraversalContext


  • public class ColladaTraversalContext
    extends java.lang.Object
    Context to keep track of state while a COLLADA document is traversed. The traversal context keeps track of the transform matrix stack that determines how COLLADA nodes are rendered.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.util.Stack<Matrix> matrixStack
      Transform matrix stack.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void initialize()
      Reset the context so that it may be used for a fresh traversal.
      void multiplyMatrix​(Matrix m)
      Multiply the matrix at the top of the stack with another matrix.
      Matrix peekMatrix()
      Returns the matrix at the top of the matrix stack, but does not modify the stack.
      Matrix popMatrix()
      Removes the matrix at the top of the matrix stack.
      void pushMatrix()
      Clone the matrix at the top of the matrix stack and push the clone onto the stack.
      void pushMatrix​(Matrix m)
      Push a matrix onto the stack.
      • Methods inherited from class java.lang.Object

        clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • matrixStack

        protected java.util.Stack<Matrix> matrixStack
        Transform matrix stack.
    • Constructor Detail

      • ColladaTraversalContext

        public ColladaTraversalContext()
        Create a new traversal context. The traversal matrix stack initially contains one element: the identity matrix.
    • Method Detail

      • peekMatrix

        public Matrix peekMatrix()
        Returns the matrix at the top of the matrix stack, but does not modify the stack.
        Returns:
        The matrix at the top of the matrix stack.
      • pushMatrix

        public void pushMatrix()
        Clone the matrix at the top of the matrix stack and push the clone onto the stack.
      • pushMatrix

        public void pushMatrix​(Matrix m)
        Push a matrix onto the stack.
        Parameters:
        m - Matrix to add to the stack. This matrix becomes the new top matrix.
      • popMatrix

        public Matrix popMatrix()
        Removes the matrix at the top of the matrix stack.
        Returns:
        The matrix that was at the top of the stack.
      • multiplyMatrix

        public void multiplyMatrix​(Matrix m)
        Multiply the matrix at the top of the stack with another matrix. The product becomes the new top matrix.
        Parameters:
        m - Matrix to multiply. Multiplication is performed as top * m.
      • initialize

        public void initialize()
        Reset the context so that it may be used for a fresh traversal.