Is there a way to access one component of a glm vector by argument?
Example:
Code :bool greaterThan( const glm::vec3& lhs, const glm::vec3& rhs, const Axis axis ) { return lhs.component( axis ) > rhs.component( axis ); }
Is there a way to access one component of a glm vector by argument?
Example:
Code :bool greaterThan( const glm::vec3& lhs, const glm::vec3& rhs, const Axis axis ) { return lhs.component( axis ) > rhs.component( axis ); }
Last edited by PrestoChung; 07-29-2013 at 02:07 PM.
Yes. You use [] with an integer. As in `lhs[axis]`, where `axis` is an integer.