So, math.select() essentially maps to a ternary operator. Is there a design reason why the parameters are exactly in the reverse order of a ternary operator? It was really counter intuitive to me when I first saw that.
I'm not sure I understand why it wouldn't use the same ordering as the ternary operator. Something like
select(condition, a, b) //a if true, otherwise b
It seems a lot more intuitive to follow the established order of the ternary since it's exactly what it does anyway.
I wasn't here for its inception - but select having the opposite ordering to ternary is very common in the GPU shader people that Unity.Mathematics is intended to be familiar to:
So, math.select() essentially maps to a ternary operator. Is there a design reason why the parameters are exactly in the reverse order of a ternary operator? It was really counter intuitive to me when I first saw that.
I'm not sure I understand why it wouldn't use the same ordering as the ternary operator. Something like
select(condition, a, b) //a if true, otherwise b
It seems a lot more intuitive to follow the established order of the ternary since it's exactly what it does anyway.