Package com.ardor3d.extension.model.collada.jdom.data

Examples of com.ardor3d.extension.model.collada.jdom.data.JointNode


            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


     * @return a new Ardor3D node, created from the given <node> element
     */
    @SuppressWarnings("unchecked")
    private Node buildNode(final Element dNode, JointNode jointNode) {
        final NodeType nodeType = getNodeType(dNode);
        final JointNode jointChildNode;
        if (nodeType == NodeType.JOINT) {
            String name = dNode.getAttributeValue("name");
            if (name == null) {
                name = dNode.getAttributeValue("id");
            }
            if (name == null) {
                name = dNode.getAttributeValue("sid");
            }
            final Joint joint = new Joint(name);
            jointChildNode = new JointNode(joint);
            jointChildNode.setParent(jointNode);
            jointNode.getChildren().add(jointChildNode);
            jointNode = jointChildNode;

            _dataCache.getElementJointMapping().put(dNode, joint);
        } else {
            jointChildNode = null;
        }

        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")) {
View Full Code Here

TOP

Related Classes of com.ardor3d.extension.model.collada.jdom.data.JointNode

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.