Package com.ardor3d.scenegraph

Examples of com.ardor3d.scenegraph.Node


        }

        final Element visualScene = _colladaDOMUtil.findTargetWithId(instance_visual_scene.getAttributeValue("url"));

        if (visualScene != null) {
            final Node sceneRoot = new Node(
                    visualScene.getAttributeValue("name") != null ? visualScene.getAttributeValue("name")
                            : "Collada Root");

            // Load each sub node and attach
            final JointNode baseJointNode = new JointNode(null);
            _dataCache.setRootJointNode(baseJointNode);
            for (final Element n : visualScene.getChildren("node")) {
                final Node subNode = buildNode(n, baseJointNode);
                if (subNode != null) {
                    sceneRoot.attachChild(subNode);
                }
            }
View Full Code Here


        String nodeName = dNode.getAttributeValue("name", (String) null);
        if (nodeName == null) { // use id if name doesn't exist
            nodeName = dNode.getAttributeValue("id", dNode.getName());
        }
        final Node node = new Node(nodeName);

        final List<Element> transforms = new ArrayList<Element>();
        for (final Element child : dNode.getChildren()) {
            if (_dataCache.getTransformTypes().contains(child.getName())) {
                transforms.add(child);
            }
        }

        // process any transform information.
        if (!transforms.isEmpty()) {
            final Transform localTransform = getNodeTransforms(transforms);

            node.setTransform(localTransform);
            if (jointChildNode != null) {
                jointChildNode.setSceneNode(node);
            }
        }

        // process any instance geometries
        for (final Element instance_geometry : dNode.getChildren("instance_geometry")) {
            _colladaMaterialUtils.bindMaterials(instance_geometry.getChild("bind_material"));

            final Spatial mesh = _colladaMeshUtils.getGeometryMesh(instance_geometry);
            if (mesh != null) {
                node.attachChild(mesh);
            }

            _colladaMaterialUtils.unbindMaterials(instance_geometry.getChild("bind_material"));
        }

        // process any instance controllers
        for (final Element instanceController : dNode.getChildren("instance_controller")) {
            _dataCache.getControllers().add(new ControllerStore(node, instanceController));
        }

        // process any instance nodes
        for (final Element in : dNode.getChildren("instance_node")) {
            final Node subNode = getNode(in, jointNode);
            if (subNode != null) {
                node.attachChild(subNode);
                if (nodeType == NodeType.JOINT
                        && getNodeType(_colladaDOMUtil.findTargetWithId(in.getAttributeValue("url"))) == NodeType.NODE) {
                    // make attachment
                    createJointAttachment(jointChildNode, node, subNode);
                }
            }
        }

        // process any concrete child nodes.
        for (final Element n : dNode.getChildren("node")) {
            final Node subNode = buildNode(n, jointNode);
            if (subNode != null) {
                node.attachChild(subNode);
                if (nodeType == NodeType.JOINT && getNodeType(n) == NodeType.NODE) {
                    // make attachment
                    createJointAttachment(jointChildNode, node, subNode);
View Full Code Here

            }

            final AssetData assetData = colladaNodeUtils.parseAsset(collada.getChild("asset"));

            // Collada may or may not have a scene, so this can return null.
            final Node scene = colladaNodeUtils.getVisualScene(collada);

            if (_loadAnimations) {
                colladaAnimUtils.parseLibraryAnimations(collada);
            }
View Full Code Here

TOP

Related Classes of com.ardor3d.scenegraph.Node

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.