Created
September 27, 2019 16:20
-
-
Save Vonflaken/9136369887df557e52ab7717c26c1123 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
const vfmath : any = { | |
clamp(value : number, min : number, max : number) : number | |
{ | |
let clamped : number = value | |
if (value > max) clamped = max | |
else if (value < min) clamped = min | |
return clamped | |
} | |
} | |
export default vfmath | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment