/// @ref core /// @file glm/detail/_vectorize.hpp #pragma once #include "type_vec1.hpp" #include "type_vec2.hpp" #include "type_vec3.hpp" #include "type_vec4.hpp" namespace glm{ namespace detail { template class vecType> struct functor1{}; template struct functor1 { GLM_FUNC_QUALIFIER static tvec1 call(R (*Func) (T x), tvec1 const & v) { return tvec1(Func(v.x)); } }; template struct functor1 { GLM_FUNC_QUALIFIER static tvec2 call(R (*Func) (T x), tvec2 const & v) { return tvec2(Func(v.x), Func(v.y)); } }; template struct functor1 { GLM_FUNC_QUALIFIER static tvec3 call(R (*Func) (T x), tvec3 const & v) { return tvec3(Func(v.x), Func(v.y), Func(v.z)); } }; template struct functor1 { GLM_FUNC_QUALIFIER static tvec4 call(R (*Func) (T x), tvec4 const & v) { return tvec4(Func(v.x), Func(v.y), Func(v.z), Func(v.w)); } }; template class vecType> struct functor2{}; template struct functor2 { GLM_FUNC_QUALIFIER static tvec1 call(T (*Func) (T x, T y), tvec1 const & a, tvec1 const & b) { return tvec1(Func(a.x, b.x)); } }; template struct functor2 { GLM_FUNC_QUALIFIER static tvec2 call(T (*Func) (T x, T y), tvec2 const & a, tvec2 const & b) { return tvec2(Func(a.x, b.x), Func(a.y, b.y)); } }; template struct functor2 { GLM_FUNC_QUALIFIER static tvec3 call(T (*Func) (T x, T y), tvec3 const & a, tvec3 const & b) { return tvec3(Func(a.x, b.x), Func(a.y, b.y), Func(a.z, b.z)); } }; template struct functor2 { GLM_FUNC_QUALIFIER static tvec4 call(T (*Func) (T x, T y), tvec4 const & a, tvec4 const & b) { return tvec4(Func(a.x, b.x), Func(a.y, b.y), Func(a.z, b.z), Func(a.w, b.w)); } }; template class vecType> struct functor2_vec_sca{}; template struct functor2_vec_sca { GLM_FUNC_QUALIFIER static tvec1 call(T (*Func) (T x, T y), tvec1 const & a, T b) { return tvec1(Func(a.x, b)); } }; template struct functor2_vec_sca { GLM_FUNC_QUALIFIER static tvec2 call(T (*Func) (T x, T y), tvec2 const & a, T b) { return tvec2(Func(a.x, b), Func(a.y, b)); } }; template struct functor2_vec_sca { GLM_FUNC_QUALIFIER static tvec3 call(T (*Func) (T x, T y), tvec3 const & a, T b) { return tvec3(Func(a.x, b), Func(a.y, b), Func(a.z, b)); } }; template struct functor2_vec_sca { GLM_FUNC_QUALIFIER static tvec4 call(T (*Func) (T x, T y), tvec4 const & a, T b) { return tvec4(Func(a.x, b), Func(a.y, b), Func(a.z, b), Func(a.w, b)); } }; }//namespace detail }//namespace glm