Package com.ardor3d.math

Examples of com.ardor3d.math.Ray3


        final Vector2 pos = Vector2.fetchTempInstance().set(screenPosition);
        if (flipVertical) {
            pos.setY(getHeight() - screenPosition.getY());
        }

        Ray3 result = store;
        if (result == null) {
            result = new Ray3();
        }
        final Vector3 origin = Vector3.fetchTempInstance();
        final Vector3 direction = Vector3.fetchTempInstance();
        getWorldCoordinates(pos, 0, origin);
        getWorldCoordinates(pos, 0.3, direction).subtractLocal(origin).normalizeLocal();
        result.setOrigin(origin);
        result.setDirection(direction);
        Vector2.releaseTempInstance(pos);
        Vector3.releaseTempInstance(origin);
        Vector3.releaseTempInstance(direction);
        return result;
    }
View Full Code Here


        _logicalLayer.registerTrigger(new InputTrigger(new MouseMovedCondition(), new TriggerAction() {
            public void perform(final Canvas source, final TwoInputStates inputStates, final double tpf) {
                // Put together a pick ray
                final Vector2 pos = Vector2.fetchTempInstance().set(inputStates.getCurrent().getMouseState().getX(),
                        inputStates.getCurrent().getMouseState().getY());
                final Ray3 pickRay = Ray3.fetchTempInstance();
                _canvas.getCanvasRenderer().getCamera().getPickRay(pos, false, pickRay);
                Vector2.releaseTempInstance(pos);

                // Do the pick
                _pickResults.clear();
View Full Code Here

                    public void perform(final Canvas source, final TwoInputStates inputStates, final double tpf) {

                        final Vector2 pos = Vector2.fetchTempInstance().set(
                                inputStates.getCurrent().getMouseState().getX(),
                                inputStates.getCurrent().getMouseState().getY());
                        final Ray3 pickRay = new Ray3();
                        _canvas.getCanvasRenderer().getCamera().getPickRay(pos, false, pickRay);
                        Vector2.releaseTempInstance(pos);
                        doPick(pickRay);
                    }
                }, "pickTrigger"));
View Full Code Here

TOP

Related Classes of com.ardor3d.math.Ray3

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.