Package com.ardor3d.scenegraph

Examples of com.ardor3d.scenegraph.Node


    public void addNode(String name, Node node) {
        nodes.put(name, node);
    }

    public Node attachToParent(String name, Spatial child) {
        Node node = getNode(name);
        node.attachChild(child);
        return node;
    }
View Full Code Here


        node.attachChild(child);
        return node;
    }

    public Node dettachFromParent(String name, Spatial child) {
        Node node = getNode(name);
        node.detachChild(child);
        return node;
    }
View Full Code Here

    /** Text fields used to present info about the example. */
    private final BasicText infoText[] = new BasicText[10];

    protected void initText( Node root,Camera camera) {
                // Setup labels for presenting example info.
        final Node textNodes = new Node("Text");
        //root.attachChild(textNodes);
        textNodes.getSceneHints().setRenderBucketType(RenderBucketType.Ortho);
        textNodes.getSceneHints().setLightCombineMode(LightCombineMode.Off);

        //final double infoStartY = camera.getHeight();
        for (int i = 0; i < infoText.length; i++) {
            infoText[i] = BasicText.createDefaultTextLabel("Text", "", 16);
            infoText[i].setTranslation(new Vector3(10, + i * 20, 0));
            textNodes.attachChild(infoText[i]);
            infoText[i].setText(" ");
        }
        textNodes.updateGeometricState(0.0);
    }
View Full Code Here

    public void addStaticModel(String name, Vector3 position, double scale, Quaternion rotation) {
        if (rotation == null)
            rotation = new Quaternion(-1,0,0,1);
        try {
            final ColladaStorage storage = new ColladaImporter().load(name);
            Node colladaNode = storage.getScene();
            colladaNode.setRotation(rotation);
            colladaNode.setTranslation(position);
            colladaNode.setScale(scale);
            staticObjectNode.attachChild(colladaNode);
        } catch (final IOException ex) {
            ex.printStackTrace();
        }       
    }
View Full Code Here

        initShaders();
        initRenderStates();

        addStaticModels();
       
        final Node reflectedNode = new Node("reflectNode");
       
        // SKY
        sky = new Sky(WATER_HEIGHT);
        reflectedNode.attachChild(sky);
        reflectedNode.attachChild(voxelPoolContainer.getNode());
        reflectedNode.attachChild(staticObjectNode);
       
        // WATER
        water = new PlainWater(camera, reflectedNode, sky, FAR_PLANE, WATER_HEIGHT); //= new Water(camera, reflectedNode, sky, FAR_PLANE, WATER_HEIGHT, timer);
        root.attachChild(reflectedNode);   
        root.attachChild(water);
View Full Code Here

        } catch (final Exception ex1) {
            System.out.println("Problem setting up terrain...");
            ex1.printStackTrace();
        }

        final Node reflectedNode = new Node("reflectNode");
        reflectedNode.attachChild(terrain);
        sky = new Sky(0.0f);
        reflectedNode.attachChild(sky);

        //water = new Water(camera, reflectedNode, sky, farPlane,0);

        root.attachChild(reflectedNode);
        root.attachChild(water);
View Full Code Here

            }
        }

        // Recurse down the scene if we're a Node and we were not flagged to ignore children.
        if (doChildren && scene instanceof Node) {
            final Node n = (Node) scene;
            if (n.getNumberOfChildren() != 0) {
                for (int i = n.getNumberOfChildren(); --i >= 0;) {
                    SkeletalDebugger.drawSkeletons(n.getChild(i), renderer, allowSkeletonRedraw, showLabels,
                            alreadyDrawn);
                }
            }
        }
    }
View Full Code Here

        }
        return copy;
    }

    protected Node clone(final Node original) {
        Node copy = null;
        try {
            copy = original.getClass().newInstance();
        } catch (final InstantiationException e) {
            logger.log(Level.SEVERE, "Could not access final constructor of class "
                    + original.getClass().getCanonicalName(), e);
            throw new RuntimeException(e);
        } catch (final IllegalAccessException e) {
            logger.log(Level.SEVERE, "Could not access final constructor of class "
                    + original.getClass().getCanonicalName(), e);
            throw new RuntimeException(e);
        }
        copy.setName(original.getName() + "_copy");
        copy.getSceneHints().set(original.getSceneHints());
        copy.setTransform(original.getTransform());

        for (final StateType type : StateType.values()) {
            final RenderState state = original.getLocalRenderState(type);
            if (state != null) {
                copy.setRenderState(state);
            }
        }
        return copy;
    }
View Full Code Here

                doChildren = false;
            }
            cam.setPlaneState(state);
        }
        if (doChildren && se instanceof Node) {
            final Node n = (Node) se;
            if (n.getNumberOfChildren() != 0) {
                for (int i = n.getNumberOfChildren(); --i >= 0;) {
                    drawBounds(n.getChild(i), r, true);
                }
            }
        }
    }
View Full Code Here

            }

        }

        if (doChildren && element instanceof Node) {
            final Node n = (Node) element;
            if (n.getNumberOfChildren() != 0) {
                for (int i = n.getNumberOfChildren(); --i >= 0;) {
                    drawNormals(n.getChild(i), r, size, true);
                }
            }
        }
    }
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.