Created
June 28, 2019 12:49
-
-
Save buesing/721c34c5f0af32536671205d444e7ba9 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
// we interpolate between the actual (received) position and the position | |
// the user would expect. after 500ms both positions are the same. | |
const fauxPosition = new Vector3().lerpVectors( | |
this.physics.ball.position, | |
new Vector3().addVectors( | |
this.physics.ball.position, | |
this.ballPositionDifference | |
), | |
this.ballInterpolationAlpha | |
); | |
this.ball.position.copy(fauxPosition); | |
this.ball.quaternion.copy(this.physics.ball.quaternion); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment