/** Multiplies this point by a scale factor. * @return a a reference to this point, for chaining. */ public Point multLocal (float s) { return mult(s, this); }
@Override public void onEnd (Pointer.Interaction iact) { // just dispatch a click if the pointer didn't move very far if (_maxDeltaSq < maxClickDeltaSq()) { clicked.emit(iact.event); return; } // if not, maybe impart some velocity float dragTime = (float)(iact.event.time - _prevStamp); if (dragTime > 0) { 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 > maxFlickSpeed) { dragVel.multLocal(maxFlickSpeed / dragSpeed); dragSpeed = maxFlickSpeed; } _vel.set(dragVel); _vel.multLocal(flickXfer); float sx = Math.signum(_vel.x), sy = Math.signum(_vel.y); _accel.x = -sx * friction; _accel.y = -sy * friction; } }
/** Multiplies this point by a scale factor. * @return a a reference to this point, for chaining. */ public Point multLocal (float s) { return mult(s, this); }