/** {@inheritDoc} Renders all nodes in this scene. */
 public void render(ColladaTraversalContext tc, DrawContext dc)
 {
     foreach (ColladaNode node in this.getNodes())
     {
         node.render(tc, dc);
     }
 }
Пример #2
0
        /** {@inheritDoc} */
        public void preRender(ColladaTraversalContext tc, DrawContext dc)
        {
            List <ColladaRenderable> children = this.getChildren();

            if (WWUtil.isEmpty(children))
            {
                return;
            }

            Matrix matrix = this.getMatrix();

            try
            {
                if (matrix != null && matrix != Matrix.IDENTITY)
                {
                    tc.pushMatrix();
                    tc.multiplyMatrix(matrix);
                }

                foreach (ColladaRenderable node in children)
                {
                    node.preRender(tc, dc);
                }
            }
            finally
            {
                if (matrix != null && matrix != Matrix.IDENTITY)
                {
                    tc.popMatrix();
                }
            }
        }
        /** {@inheritDoc} Renders the target of the instance pointer, if the target can be resolved. */
        public void render(ColladaTraversalContext tc, DrawContext dc)
        {
            ColladaNode instance = this.get();

            if (instance != null)
            {
                instance.render(tc, dc);
            }
        }
Пример #4
0
        /** {@inheritDoc} */
        public void render(ColladaTraversalContext tc, DrawContext dc)
        {
            ColladaInstanceVisualScene sceneInstance = this.getInstanceVisualScene();

            if (sceneInstance != null)
            {
                sceneInstance.render(tc, dc);
            }
        }
        /** {@inheritDoc} Renders the target of the instance pointer, if the target can be resolved. */
        public void preRender(ColladaTraversalContext tc, DrawContext dc)
        {
            ColladaVisualScene instance = this.get();

            if (instance != null)
            {
                instance.preRender(tc, dc);
            }
        }
Пример #6
0
        public Box getLocalExtent(ColladaTraversalContext tc)
        {
            if (tc == null)
            {
                String msg = Logging.getMessage("nullValue.TraversalContextIsNull");
                Logging.logger().severe(msg);
                throw new ArgumentException(msg);
            }

            // Create shapes for this node, if necessary
            if (this.shapes == null)
            {
                this.shapes = this.createShapes();
            }

            if (this.getMatrix() != null)
            {
                tc.pushMatrix();
                tc.multiplyMatrix(this.getMatrix());
            }

            ArrayList <Box> extents = new ArrayList <Box>();

            foreach (ColladaMeshShape shape in this.shapes)
            {
                Box extent = shape.getLocalExtent(tc);
                if (extent != null)
                {
                    extents.add(extent);
                }
            }

            if (this.children != null)
            {
                foreach (ColladaRenderable node in children)
                {
                    Box extent = node.getLocalExtent(tc);
                    if (extent != null)
                    {
                        extents.add(extent);
                    }
                }
            }

            if (this.getMatrix() != null)
            {
                tc.popMatrix();
            }

            if (extents.isEmpty())
            {
                return(null);
            }

            return(Box.union(extents));
        }
Пример #7
0
        /**
         * Returns this renderable's model coordinate extent.
         *
         * @param tc The traversal context to use when determining the extent.
         * @return The model coordinate extent.
         *
         * @throws ArgumentException if either the traversal context is null.
         */
        public Box getLocalExtent(ColladaTraversalContext tc)
        {
            if (tc == null)
            {
                String message = Logging.getMessage("nullValue.TraversalContextIsNull");
                Logging.logger().severe(message);
                throw new ArgumentException(message);
            }

            return(null);
        }
Пример #8
0
        public Box getLocalExtent(ColladaTraversalContext tc)
        {
            if (tc == null)
            {
                String message = Logging.getMessage("nullValue.TraversalContextIsNull");
                Logging.logger().severe(message);
                throw new ArgumentException(message);
            }

            ColladaInstanceVisualScene sceneInstance = this.getInstanceVisualScene();

            return(sceneInstance != null?sceneInstance.getLocalExtent(tc) : null);
        }
Пример #9
0
        /** {@inheritDoc} */
        public void render(ColladaTraversalContext tc, DrawContext dc)
        {
            // Create shapes for this node, if necessary
            if (this.shapes == null)
            {
                this.shapes = this.createShapes();
            }

            Matrix matrix = this.getMatrix();

            try
            {
                if (matrix != null && matrix != Matrix.IDENTITY)
                {
                    tc.pushMatrix();
                    tc.multiplyMatrix(matrix);
                }

                ColladaRoot root = this.getRoot();

                // Apply the current root position and highlight state to shapes in this node. Do this every frame so that
                // the node will pickup changes in the root's state.
                bool     highlighted  = root.isHighlighted();
                int      altitudeMode = root.getAltitudeMode();
                Position position     = root.getPosition();

                Matrix traversalMatrix = tc.peekMatrix();
                foreach (ColladaMeshShape shape in this.shapes)
                {
                    shape.setModelPosition(position);
                    shape.setAltitudeMode(altitudeMode);
                    shape.setHighlighted(highlighted);

                    shape.render(dc, traversalMatrix);
                }

                foreach (ColladaRenderable node in this.getChildren())
                {
                    node.render(tc, dc);
                }
            }
            finally
            {
                if (matrix != null && matrix != Matrix.IDENTITY)
                {
                    tc.popMatrix();
                }
            }
        }
Пример #10
0
        public Box getLocalExtent(ColladaTraversalContext tc)
        {
            if (tc == null)
            {
                String message = Logging.getMessage("nullValue.TraversalContextIsNull");
                Logging.logger().severe(message);
                throw new ArgumentException(message);
            }

            ArrayList <Box> extents = new ArrayList <Box>();

            foreach (ColladaNode node in this.getNodes())
            {
                Box extent = node.getLocalExtent(tc);
                if (extent != null)
                {
                    extents.add(extent);
                }
            }

            return(extents.isEmpty() ? null : Box.union(extents));
        }
        public Box getLocalExtent(ColladaTraversalContext tc)
        {
            ColladaNode instance = this.get();

            return(instance != null?instance.getLocalExtent(tc) : null);
        }