gmlscripts

ease_towards_direction

Jun 26th, 2014
380
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /// ease_towards_direction(target, rate, easing)
  2. //
  3. //  Rotates the calling instance towards the target direction,
  4. //  at a given rate and easing. Easing makes the turn complete
  5. //  more gradually.
  6. //
  7. //      target      angle to turn towards
  8. //      rate        maximum turning rate
  9. //      easing      amount of easing, 0..1, no easing to infinite easing
  10. //
  11. /// GMLscripts.com/license
  12. {
  13.     direction += median(-argument1, argument1, (1-argument2) * angle_difference(argument0, direction));
  14. }
Advertisement
Add Comment
Please, Sign In to add comment