Package com.jme.math

Examples of com.jme.math.Vector3f.subtract()


     */
    public static float pointLineDistance( final Vector3f lineStart,
                                           final Vector3f lineEnd,
                                           final Vector3f point ) {
        Vector3f a = new Vector3f(lineEnd);
        a.subtract(lineStart);
       
        Vector3f b = new Vector3f(lineStart);
        b.subtract(point);
       
        Vector3f cross = new Vector3f();
View Full Code Here


                                           final Vector3f point ) {
        Vector3f a = new Vector3f(lineEnd);
        a.subtract(lineStart);
       
        Vector3f b = new Vector3f(lineStart);
        b.subtract(point);
       
        Vector3f cross = new Vector3f();
        cross.cross(a,b);
       
        return cross.length()/a.length();
View Full Code Here

                // Convert from world to parent coordinates.
                Node viewNode = ((View2DEntity)view.getParent()).getNode();
                Vector3f curWorld = dragStartWorld.add(dragVectorWorld, new Vector3f());
                Vector3f curLocal = viewNode.worldToLocal(curWorld, new Vector3f());
                dragVectorLocal = curLocal.subtract(dragStartLocal);
            }
            return action;

        case MouseEvent.MOUSE_RELEASED:
            if (me.getButton() == MouseEvent.BUTTON1) {
View Full Code Here

                // Convert from world to local coordinates.
                Node viewNode = view.getNode();
                Vector3f curWorld = dragStartWorld.add(dragVectorWorld, new Vector3f());
                Vector3f curLocal = viewNode.worldToLocal(curWorld, new Vector3f());
                dragVectorLocal = curLocal.subtract(dragStartLocal);
            }
            return action;

        case MouseEvent.MOUSE_RELEASED:
            if (me.getButton() == MouseEvent.BUTTON1) {
View Full Code Here

            // Convert from world to parent coordinates.
            Node viewNode = ((View2DEntity)view.getParent()).getNode();
            Vector3f curWorld = dragStartWorld.add(dragVectorWorld, new Vector3f());
            Vector3f curLocal = viewNode.worldToLocal(curWorld, new Vector3f());
            dragVectorLocal = curLocal.subtract(dragStartLocal);

            //System.err.println("dragVectorLocal = " + dragVectorLocal);
            App2D.invokeLater(new Runnable() {
                public void run () {
                    if (view != null) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.