Package pythagoras.f

Examples of pythagoras.f.Point.distance()


        }
        // if not, maybe impart some velocity
        float dragTime = (float)(_curStamp - _prevStamp);
        Point delta = new Point(_cur.x - _prev.x, _cur.y - _prev.y);
        Point dragVel = delta.mult(1 / dragTime);
        float dragSpeed = dragVel.distance(0, 0);
        if (dragSpeed > flickSpeedThresh() && delta.distance(0, 0) > minFlickDelta()) {
            if (dragSpeed > maxFlickSpeed()) {
                dragVel.multLocal(maxFlickSpeed() / dragSpeed);
                dragSpeed = maxFlickSpeed();
            }
View Full Code Here


            break;

        case MOVE:
            Point start = _startPoints.get(node.touch.id());
            if (start == null) Log.log.warning("No start for a moved touch", "id", node.touch.id());
            else if (start.distance(node.location()) > MOVE_THRESHOLD) setState(State.UNQUALIFIED);
            break;

        case CANCEL:
            setState(State.UNQUALIFIED);
            break;
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.