Open swiftcoder opened 5 years ago
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.
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 toVectorSpace
for consistency with numeric types.