Package com.ardor3d.scenegraph

Examples of com.ardor3d.scenegraph.Node


        if (!_calcRay.intersectsPlane(pickPlane, _calcVec3B)) {
            return _calcVec3A.zero();
        }

        // convert to target coord space
        final Node parent = manager.getSpatialTarget().getParent();
        if (parent != null) {
            parent.getWorldTransform().applyInverse(_calcVec3A);
            parent.getWorldTransform().applyInverse(_calcVec3B);
        }

        return _calcVec3B.subtractLocal(_calcVec3A);
    }
View Full Code Here


    protected AbstractInteractWidget _lastInputWidget = null;

    protected InteractMatrix _interactMatrix;

    public CompoundInteractWidget() {
        _handle = new Node("handleRoot");
    }
View Full Code Here

    protected ColorRGBA _zColor = new ColorRGBA(0, 0, 1, .65f);

    protected InteractMatrix _interactMatrix = InteractMatrix.World;

    public MoveWidget() {
        _handle = new Node("moveHandle");

        final BlendState blend = new BlendState();
        blend.setBlendEnabled(true);
        _handle.setRenderState(blend);
View Full Code Here

        // Cast us to the line along our arrow
        arrowLine.distanceSquared(_calcVec3A, _calcVec3C);
        arrowLine.distanceSquared(_calcVec3B, _calcVec3D);

        // convert to target coord space
        final Node parent = manager.getSpatialTarget().getParent();
        if (parent != null) {
            parent.getWorldTransform().applyInverse(_calcVec3C);
            parent.getWorldTransform().applyInverse(_calcVec3D);
        }

        return _calcVec3D.subtractLocal(_calcVec3C);
    }
View Full Code Here

    public enum MovePlane {
        XY, XZ, YZ
    }

    public MovePlanarWidget() {
        _handle = new Node("moveHandle");

        final BlendState blend = new BlendState();
        blend.setBlendEnabled(true);
        _handle.setRenderState(blend);
View Full Code Here

        if (!_calcRay.intersectsPlane(pickPlane, _calcVec3B)) {
            return _calcVec3A.zero();
        }

        // convert to target coord space
        final Node parent = manager.getSpatialTarget().getParent();
        if (parent != null) {
            parent.getWorldTransform().applyInverse(_calcVec3A);
            parent.getWorldTransform().applyInverse(_calcVec3B);
        }

        return _calcVec3B.subtractLocal(_calcVec3A);
    }
View Full Code Here

    protected InteractRing _xRing = null;
    protected InteractRing _yRing = null;
    protected InteractRing _zRing = null;

    public RotateWidget() {
        _handle = new Node("rotationHandle");

        final BlendState blend = new BlendState();
        blend.setBlendEnabled(true);
        _handle.setRenderState(blend);
View Full Code Here

            _rotateStore.multiplyLocal(new Quaternion().fromVectorToVector(_calcVec3A, _calcVec3B).toRotationMatrix(
                    _calcMat3));
        }

        // convert to target coord space
        final Node parent = manager.getSpatialTarget().getParent();
        if (parent != null) {
            parent.getWorldTransform().applyInverseVector(_calcVec3A);
            parent.getWorldTransform().applyInverseVector(_calcVec3B);
        }

        // return a rotation to take us to the new rotation
        return new Quaternion().fromVectorToVector(_calcVec3A, _calcVec3B);
    }
View Full Code Here

     * Creates the scene objects.
     *
     * @return the node containing the objects
     */
    private Node createObjects() {
        final Node objects = new Node("objects");

        final Torus torus = new Torus("Torus", 50, 50, 8, 17);
        torus.setTranslation(new Vector3(50, -5, 20));
        TextureState ts = new TextureState();
        torus.addController(new SpatialController<Torus>() {
            private double timer = 0;
            private final Matrix3 rotation = new Matrix3();

            public void update(final double time, final Torus caller) {
                timer += time * 0.5;
                caller.setTranslation(Math.sin(timer) * 40.0, Math.sin(timer) * 40.0, Math.cos(timer) * 40.0);
                rotation.fromAngles(timer * 0.5, timer * 0.5, timer * 0.5);
                caller.setRotation(rotation);
            }
        });

        Texture t0 = TextureManager.load("images/ardor3d_white_256.jpg",
                Texture.MinificationFilter.BilinearNearestMipMap, true);
        ts.setTexture(t0, 0);
        ts.setEnabled(true);
        torus.setRenderState(ts);
        objects.attachChild(torus);

        ts = new TextureState();
        t0 = TextureManager
                .load("images/ardor3d_white_256.jpg", Texture.MinificationFilter.BilinearNearestMipMap, true);
        t0.setWrap(Texture.WrapMode.Repeat);
        ts.setTexture(t0);

        Box box = new Box("box1", new Vector3(-10, -10, -10), new Vector3(10, 10, 10));
        box.setTranslation(new Vector3(0, -7, 0));
        box.setRenderState(ts);
        objects.attachChild(box);

        box = new Box("box2", new Vector3(-5, -5, -5), new Vector3(5, 5, 5));
        box.setTranslation(new Vector3(15, 10, 0));
        box.setRenderState(ts);
        objects.attachChild(box);

        box = new Box("box3", new Vector3(-5, -5, -5), new Vector3(5, 5, 5));
        box.setTranslation(new Vector3(0, -10, 15));
        box.setRenderState(ts);
        objects.attachChild(box);

        box = new Box("box4", new Vector3(-5, -5, -5), new Vector3(5, 5, 5));
        box.setTranslation(new Vector3(20, 0, 0));
        box.setRenderState(ts);
        objects.attachChild(box);

        ts = new TextureState();
        t0 = TextureManager
                .load("images/ardor3d_white_256.jpg", Texture.MinificationFilter.BilinearNearestMipMap, true);
        t0.setWrap(Texture.WrapMode.Repeat);
        ts.setTexture(t0);

        box = new Box("box5", new Vector3(-50, -2, -50), new Vector3(50, 2, 50));
        box.setTranslation(new Vector3(0, -15, 0));
        box.setRenderState(ts);
        box.setModelBound(new BoundingBox());
        objects.attachChild(box);

        return objects;
    }
View Full Code Here

    /**
     * Creates the debug quads.
     */
    private void createDebugQuads() {
        debugQuadsNode = new Node("quadNode");
        debugQuadsNode.getSceneHints().setCullHint(CullHint.Never);

        final double quadSize = _canvas.getCanvasRenderer().getCamera().getWidth() / 10;

        Quad debugQuad = new Quad("reflectionQuad", quadSize, quadSize);
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.