// // Lol Engine // // Copyright: (c) 2010-2013 Sam Hocevar // This program is free software; you can redistribute it and/or // modify it under the terms of the Do What The Fuck You Want To // Public License, Version 2, as published by Sam Hocevar. See // http://www.wtfpl.net/ for more details. // #include namespace lol { #define LOL_VEC_2_CONST(T, name, a, b) \ template<> \ vec_t const vec_t::name = vec_t((T)a, (T)b); #define LOL_VEC_3_CONST(T, name, a, b, c) \ template<> \ vec_t const vec_t::name = vec_t((T)a, (T)b, (T)c); #define LOL_VEC_4_CONST(T, name, a, b, c, d) \ template<> \ vec_t const vec_t::name = vec_t((T)a, (T)b, (T)c, (T)d); #define LOL_MAT_CONST(T, name, a) \ template<> \ mat_t const mat_t::name = mat_t((T)a); \ \ template<> \ mat_t const mat_t::name = mat_t((T)a); \ \ template<> \ mat_t const mat_t::name = mat_t((T)a); #define LOL_ALL_CONST_INNER(T) \ LOL_VEC_2_CONST(T, zero, 0, 0) \ LOL_VEC_2_CONST(T, axis_x, 1, 0) \ LOL_VEC_2_CONST(T, axis_y, 0, 1) \ \ LOL_VEC_3_CONST(T, zero, 0, 0, 0) \ LOL_VEC_3_CONST(T, axis_x, 1, 0, 0) \ LOL_VEC_3_CONST(T, axis_y, 0, 1, 0) \ LOL_VEC_3_CONST(T, axis_z, 0, 0, 1) \ \ LOL_VEC_4_CONST(T, zero, 0, 0, 0, 0) \ LOL_VEC_4_CONST(T, axis_x, 1, 0, 0, 0) \ LOL_VEC_4_CONST(T, axis_y, 0, 1, 0, 0) \ LOL_VEC_4_CONST(T, axis_z, 0, 0, 1, 0) \ LOL_VEC_4_CONST(T, axis_w, 0, 0, 0, 1) \ \ LOL_MAT_CONST(T, identity, 1) #if LOL_FEATURE_CXX11_UNRESTRICTED_UNIONS LOL_ALL_CONST_INNER(half) #endif LOL_ALL_CONST_INNER(float) LOL_ALL_CONST_INNER(double) LOL_ALL_CONST_INNER(ldouble) #if LOL_FEATURE_CXX11_UNRESTRICTED_UNIONS LOL_ALL_CONST_INNER(real) #endif LOL_ALL_CONST_INNER(int8_t) LOL_ALL_CONST_INNER(uint8_t) LOL_ALL_CONST_INNER(int16_t) LOL_ALL_CONST_INNER(uint16_t) LOL_ALL_CONST_INNER(int32_t) LOL_ALL_CONST_INNER(uint32_t) LOL_ALL_CONST_INNER(int64_t) LOL_ALL_CONST_INNER(uint64_t) }; /* namespace lol */