add clamp function
This commit is contained in:
parent
0dc0db98a9
commit
ca1ddbdeed
@ -108,4 +108,8 @@ function Library (ronin) {
|
|||||||
this.div = function (a, b) {
|
this.div = function (a, b) {
|
||||||
return a / b
|
return a / b
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.clamp = function (val, min, max) {
|
||||||
|
return Math.min(max, Math.max(min, val))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user