Package com.ardor3d.scenegraph

Examples of com.ardor3d.scenegraph.Node


            }

        }

        if (doChildren && element instanceof Node) {
            final Node n = (Node) element;
            if (n.getNumberOfChildren() != 0) {
                for (int i = n.getNumberOfChildren(); --i >= 0;) {
                    drawTangents(n.getChild(i), r, size, true);
                }
            }
        }
    }
View Full Code Here


            rods.draw(r);
        }

        if ((spat instanceof Node) && drawChildren) {
            final Node n = (Node) spat;
            if (n.getNumberOfChildren() == 0) {
                return;
            }
            for (int x = 0, count = n.getNumberOfChildren(); x < count; x++) {
                drawAxis(n.getChild(x), r, drawChildren, drawAll);
            }
        }
    }
View Full Code Here

        return res;
    }

    public static void trimEmptyBranches(final Spatial spatial) {
        if (spatial instanceof Node) {
            final Node node = (Node) spatial;
            for (int i = node.getNumberOfChildren(); --i >= 0;) {
                trimEmptyBranches(node.getChild(i));
            }
            if (node.getNumberOfChildren() <= 0) {
                spatial.removeFromParent();
            }
        }
    }
View Full Code Here

        }

        if (spatial instanceof Pickable) {
            results.addPick(ray, (Pickable) spatial);
        } else if (spatial instanceof Node) {
            final Node node = (Node) spatial;
            for (int i = node.getNumberOfChildren() - 1; i >= 0; i--) {
                findPick(node.getChild(i), ray, results, ignoreCulled);
            }
        }
    }
View Full Code Here

                || !scene.getSceneHints().isPickingHintEnabled(PickingHint.Collidable)) {
            return;
        }

        if (spatial instanceof Node) {
            final Node node = (Node) spatial;

            if (node.getWorldBound().intersects(scene.getWorldBound())) {
                // further checking needed.
                for (int i = 0; i < node.getNumberOfChildren(); i++) {
                    PickingUtil.findCollisions(node.getChild(i), scene, results);
                }
            }
        } else if (spatial instanceof Mesh) {
            final Mesh mesh = (Mesh) spatial;

            if (mesh.getWorldBound().intersects(scene.getWorldBound())) {
                if (scene instanceof Node) {
                    final Node parent = (Node) scene;
                    for (int i = 0; i < parent.getNumberOfChildren(); i++) {
                        PickingUtil.findCollisions(mesh, parent.getChild(i), results);
                    }
                } else {
                    results.addCollision(mesh, (Mesh) scene);
                }
            }
View Full Code Here

                || !scene.getSceneHints().isPickingHintEnabled(PickingHint.Collidable)) {
            return false;
        }

        if (spatial instanceof Node) {
            final Node node = (Node) spatial;

            if (node.getWorldBound().intersects(scene.getWorldBound())) {
                if (node.getNumberOfChildren() == 0 && !checkPrimitives) {
                    return true;
                }
                // further checking needed.
                for (int i = 0; i < node.getNumberOfChildren(); i++) {
                    if (PickingUtil.hasCollision(node.getChild(i), scene, checkPrimitives)) {
                        return true;
                    }
                }
            }
        } else if (spatial instanceof Mesh) {
            final Mesh mesh = (Mesh) spatial;

            if (mesh.getWorldBound().intersects(scene.getWorldBound())) {
                if (scene instanceof Node) {
                    final Node parent = (Node) scene;
                    for (int i = 0; i < parent.getNumberOfChildren(); i++) {
                        if (PickingUtil.hasCollision(mesh, parent.getChild(i), checkPrimitives)) {
                            return true;
                        }
                    }

                    return false;
View Full Code Here

        _imposterQuad.getSceneHints().setLightCombineMode(LightCombineMode.Off);
        super.attachChild(_imposterQuad);

        getSceneHints().setRenderBucketType(RenderBucketType.Transparent);

        _targetScene = new Node();
        super.attachChild(_targetScene);

        for (int i = 0; i < _corners.length; i++) {
            _corners[i] = new Vector3();
        }
View Full Code Here

     */
    public UIComponent getTopLevelComponent() {
        if (isAttachedToHUD()) {
            return this;
        }
        final Node parent = getParent();
        if (parent instanceof UIComponent) {
            return ((UIComponent) parent).getTopLevelComponent();
        } else {
            return null;
        }
View Full Code Here

    /**
     * @return the first instance of UIHud found in this Component's UIComponent ancestry or null if none are found.
     */
    public UIHud getHud() {
        final Node parent = getParent();
        if (parent instanceof UIHud) {
            return (UIHud) parent;
        } else if (parent instanceof UIComponent) {
            return ((UIComponent) parent).getHud();
        } else {
View Full Code Here

    public MoveMultiPlanarWidget() {
        this(0.5);
    }

    public MoveMultiPlanarWidget(final double extent) {
        _handle = new Node("moveHandle");

        final BlendState blend = new BlendState();
        blend.setBlendEnabled(true);
        _handle.setRenderState(blend);
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.