1/// @ref gtx_exterior_product 2 3#include <limits> 4 5namespace glm { 6namespace detail 7{ 8 template<typename T, qualifier Q, bool Aligned> 9 struct compute_cross_vec2 10 { 11 GLM_FUNC_QUALIFIER static T call(vec<2, T, Q> const& v, vec<2, T, Q> const& u) 12 { 13 GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'cross' accepts only floating-point inputs"); 14 15 return v.x * u.y - u.x * v.y; 16 } 17 }; 18}//namespace detail 19 20 template<typename T, qualifier Q> 21 GLM_FUNC_QUALIFIER T cross(vec<2, T, Q> const& x, vec<2, T, Q> const& y) 22 { 23 return detail::compute_cross_vec2<T, Q, detail::is_aligned<Q>::value>::call(x, y); 24 } 25}//namespace glm 26 27