smoother fling
This commit is contained in:
parent
8c8750a833
commit
72741ced7f
@ -25,7 +25,6 @@ import org.oscim.core.PointD;
|
|||||||
import org.oscim.core.PointF;
|
import org.oscim.core.PointF;
|
||||||
import org.oscim.core.Tile;
|
import org.oscim.core.Tile;
|
||||||
import org.oscim.utils.FastMath;
|
import org.oscim.utils.FastMath;
|
||||||
import org.oscim.utils.Interpolation;
|
|
||||||
import org.oscim.utils.Matrix4;
|
import org.oscim.utils.Matrix4;
|
||||||
|
|
||||||
import android.opengl.Matrix;
|
import android.opengl.Matrix;
|
||||||
@ -731,12 +730,10 @@ public class MapViewPosition {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
synchronized boolean fling(long millisLeft){
|
synchronized boolean fling(float adv){
|
||||||
|
|
||||||
float delta = (mDuration - millisLeft) / mDuration;
|
//float delta = (mDuration - millisLeft) / mDuration;
|
||||||
float adv = Interpolation.exp5Out.apply(delta);
|
adv = (float)Math.sqrt(adv);
|
||||||
//adv *= Interpolation.
|
|
||||||
//float adv = delta;
|
|
||||||
float dx = mVelocityX * adv;
|
float dx = mVelocityX * adv;
|
||||||
float dy = mVelocityY * adv;
|
float dy = mVelocityY * adv;
|
||||||
|
|
||||||
@ -817,7 +814,7 @@ public class MapViewPosition {
|
|||||||
updatePosition();
|
updatePosition();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mAnimFling && fling(millisLeft))
|
if (mAnimFling && fling(adv))
|
||||||
changed = true;
|
changed = true;
|
||||||
|
|
||||||
if (changed)
|
if (changed)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user