Created
November 26, 2015 12:10
-
-
Save peroon/0735e794680e56a72b90 to your computer and use it in GitHub Desktop.
Interpolate.cs
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
// Interpolate the position and the rotation. | |
var p = (t - intervalCounter) / delta; | |
var position = Vector3.Lerp(previousPosition, transform.position, p); | |
var rotation = Quaternion.Slerp(previousRotation, transform.rotation, p); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment