Last active
August 27, 2018 14:33
-
-
Save drhayes/271eb22b098ba6d19bc298526ecd1f2a to your computer and use it in GitHub Desktop.
Slerp between rotations without doing the flippy thing.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local ax, ay = math.cos(fov.angle), math.sin(fov.angle) | |
local gx, gy = math.cos(goalAngle), math.sin(goalAngle) | |
ax, ay = ax + gx * 5 * dt, ay + gy * 5 * dt | |
fov.angle = math.atan2(ay, ax) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment