Merge: math: Intro `Comparable::clamp`
authorJean Privat <jean@pryen.org>
Mon, 27 Jun 2016 21:58:42 +0000 (17:58 -0400)
committerJean Privat <jean@pryen.org>
Mon, 27 Jun 2016 21:58:42 +0000 (17:58 -0400)
The `clamp` service restricts a value within a given range. It is a common service in GLSL and it is especially useful for games. Even though the alternative is short: `x = x.min(1.0).max(0.0)`, it is quite confusing and the simple `x = x.clamp(0.0, 1.0)` is easier to read.

Pull-Request: #2207
Reviewed-by: Jean Privat <jean@pryen.org>
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>


Trivial merge