Bruno Binet
|
a64e4ae579
|
Merge pull request #164 from bbinet/kinetic
Add support for kinetic effect while dragging
|
2013-01-30 06:26:01 -08:00 |
|
Bruno Binet
|
d2f30986db
|
Set kinetic getDuration instance method to @private
|
2013-01-30 14:46:49 +01:00 |
|
Bruno Binet
|
dff8c2b2b2
|
Renaming to be more consistent with ol3 style
s/v_0/initialVelocity/
s/v_min/minVelocity/
|
2013-01-30 14:46:49 +01:00 |
|
Bruno Binet
|
d91e1d30d4
|
Get rid of binarySelect to find the first point.
|
2013-01-30 14:46:49 +01:00 |
|
Bruno Binet
|
79849888db
|
Kinetic now returns directly the pre-render function
instead of returning the kinetic easing function only.
(thanks @fredj)
|
2013-01-29 15:34:11 +01:00 |
|
Bruno Binet
|
2bb8a5cfd9
|
Stop current kinetic animation on DOWN events
|
2013-01-29 14:32:38 +01:00 |
|
Bruno Binet
|
39cbba3eb7
|
Add a frameState property to ol.MapBrowserEvent
so that we will be able to retrieve the current center of the view2d from the
framestate in the dragpan interaction.
|
2013-01-29 13:00:02 +01:00 |
|
Bruno Binet
|
d54864695d
|
Add a removePreRenderFunction method to ol.Map
This will remove the pre-render function from preRenderFunctions_ array if
found.
|
2013-01-29 12:56:15 +01:00 |
|
Bruno Binet
|
7d0b4c757e
|
Activate kinetic effect by default
|
2013-01-29 12:39:52 +01:00 |
|
Bruno Binet
|
8a9738d755
|
Add support for kinetic effect while dragging.
Only dragpan interaction is supported for now.
The kinetic effect use the maths below (thx @twpayne):
Rate of decay (number, must be negative) = α
Minimum velocity (pixels/millisecond) = v_min
Initial velocity (pixels/millisecond) = v₀
Velocity at time t (pixels/millisecond) =
α⋅t
v₀⋅ℯ
Distance travelled at time t (pixels) =
⎛ α⋅t ⎞
v₀⋅⎝ℯ - 1⎠
─────────────
α
Duration of animation (milliseconds) =
⎛v_min⎞
log⎜─────⎟
⎝ v₀ ⎠
──────────
α
Total distance travelled (pixels) =
-v₀ + v_min
───────────
α
Easing function =
⎛ α⋅duration⋅t ⎞
v₀⋅⎝ℯ - 1⎠
──────────────────────
-v₀ + v_min
|
2013-01-29 12:39:52 +01:00 |
|