title: 2d Game Physics Ease In / Out Based on Velocity
body: <p>I've recently been experimenting and attempting to recreate an iOS UI sort of edge bouncing effect in my game so that if you scroll past a level's boundaries, the camera slowly bounces back to the boundary.</p>
  
  <p>At the moment I've implemented some of Robert Penner's tweening calculations ported from ActionScript, however I'm unsure whether this is the correct approach due to the fact that it doesn't take into account our camera's velocity. At the moment it looks something like this:</p>
  
  <p><code>easeInOut(currentTime, startValue, endValue, duration);</code></p>
  
  <p>The actual implementations are available here: <a href="http://www.jesusgollonet.com/blog/2007/09/24/penner-easing-cpp/" rel="nofollow">http://www.jesusgollonet.com/blog/2007/09/24/penner-easing-cpp/</a></p>
  
  <p>I've come to the conclusion that this is a sort of grey area as I haven't been able to find much information on it, either that or I'm not familiar with the correct name for the sort of calculation I'm attempting to describe. If anyone has any advice on using velocity in an easing in/out calculation in a 2d game or UI, I'd be very interested to hear it!</p>