cgmath
cgmath copied to clipboard
Add element-wise abs()
Taking the element-wise absolute value of a vector is a pretty common operation in GLSL. It would be lovely to have an abs_element_wise().
Maybe also a .abs() added to VectorSpace for consistency with numeric types.
You should be able to accomplish this with {vector/point}.map(|n| n.abs()).
That is how I'm accomplishing this currently, but from my perspective it's a sufficiently common operation that it'd be nice to have it in the main API.