Why this throws an compilation error: no matching function for call to ‘cross(glm::vec4&, glm::vec4&)’
glm::vec4 a;
glm::vec4 b;
glm::vec4 c = glm::cross(a, b);
but it works fine for vec3?
There is no such thing as a 4D vector cross-product; the operation is only defined for 3D vectors. Well, technically, there is a seven-dimensional vector cross-product, but somehow I don't think you're looking for that.
Since 4D vector cross-products aren't mathematically reasonable, GLM doesn't offer a function to compute it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With