Home | History | Annotate | Download | only in common

Lines Matching refs:velocity

86      * velocity which is preserved in the bounce when the horizontal edge is reached. A null value
103 * velocity which is preserved in the bounce when the horizontal edge is reached. A null value
172 * Returns the absolute value of the current velocity.
174 * @return The original velocity less the deceleration, norm of the X and Y velocity vector.
407 * depend on the initial velocity of the fling.
411 * @param velocityX Initial velocity of the fling (X) measured in pixels per
413 * @param velocityY Initial velocity of the fling (Y) measured in pixels per
549 // Initial velocity
552 // Current velocity
657 * Get a signed deceleration that will reduce the velocity.
659 static private float getDeceleration(int velocity) {
660 return velocity > 0 ? -GRAVITY : GRAVITY;
734 private void startSpringback(int start, int end, int velocity) {
742 // TODO take velocity into account
748 void fling(int start, int velocity, int min, int max, int over) {
751 mCurrVelocity = mVelocity = velocity;
757 startAfterEdge(start, min, max, velocity);
764 if (velocity != 0) {
765 mDuration = mSplineDuration = getSplineFlingDuration(velocity);
766 totalDistance = getSplineFlingDistance(velocity);
769 mSplineDistance = (int) (totalDistance * Math.signum(velocity));
784 private double getSplineDeceleration(int velocity) {
785 return Math.log(INFLEXION * Math.abs(velocity) / (mFlingFriction * PHYSICAL_COEF));
788 private double getSplineFlingDistance(int velocity) {
789 final double l = getSplineDeceleration(velocity);
795 private int getSplineFlingDuration(int velocity) {
796 final double l = getSplineDeceleration(velocity);
801 private void fitOnBounceCurve(int start, int end, int velocity) {
803 final float durationToApex = - velocity / mDeceleration;
804 final float distanceToApex = velocity * velocity / 2.0f / Math.abs(mDeceleration);
813 private void startBounceAfterEdge(int start, int end, int velocity) {
814 mDeceleration = getDeceleration(velocity == 0 ? start - end : velocity);
815 fitOnBounceCurve(start, end, velocity);
819 private void startAfterEdge(int start, int min, int max, int velocity) {
828 boolean keepIncreasing = overDistance * velocity >= 0;
830 // Will result in a bounce or a to_boundary depending on velocity.
831 startBounceAfterEdge(start, edge, velocity);
833 final double totalDistance = getSplineFlingDistance(velocity);
835 fling(start, velocity, positive ? min : start, positive ? start : max, mOver);
837 startSpringback(start, edge, velocity);
847 // We were in fling/scroll mode before: current velocity is such that distance to
873 // Duration from start to null velocity
900 * Update the current position and velocity for current time. Returns