Dav1dde / gl3n

OpenGL Maths for D (not glm for D).
http://dav1dde.github.com/gl3n/
Other
103 stars 49 forks source link

element-wise clamp #41

Open John-Colvin opened 10 years ago

John-Colvin commented 10 years ago

Wouldn't it be neat to be able to write:

assert(clamp(vec2(-4.3, 2), -3, 4) == vec2(-3, 2));
assert(clamp(vec2(-2, 4), vec2(0, 0), vec2(1, 3)) == vec2(0, 3));
Dav1dde commented 10 years ago

I like the idea. Hopefully I have time in the next week(s) to work on all the open issues.