Created
June 16, 2018 14:47
-
-
Save philipshen/2f0863609b353adc42fdccd5006d960e 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
update(dt) { | |
const { angleSpeed } = this; | |
if (angleSpeed !== 0) { | |
const angle = this.angle = MathUtilities.clamp(this.angle + angleSpeed * dt, | |
this.leftMaxAngle * -1, | |
this.rightMaxAngle); | |
this.barrel.rotation = angle; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment