type_vec4.hpp 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528
  1. ///////////////////////////////////////////////////////////////////////////////////
  2. /// OpenGL Mathematics (glm.g-truc.net)
  3. ///
  4. /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net)
  5. /// Permission is hereby granted, free of charge, to any person obtaining a copy
  6. /// of this software and associated documentation files (the "Software"), to deal
  7. /// in the Software without restriction, including without limitation the rights
  8. /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  9. /// copies of the Software, and to permit persons to whom the Software is
  10. /// furnished to do so, subject to the following conditions:
  11. ///
  12. /// The above copyright notice and this permission notice shall be included in
  13. /// all copies or substantial portions of the Software.
  14. ///
  15. /// Restrictions:
  16. /// By making use of the Software for military purposes, you choose to make
  17. /// a Bunny unhappy.
  18. ///
  19. /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  20. /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  21. /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  22. /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  23. /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  24. /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  25. /// THE SOFTWARE.
  26. ///
  27. /// @ref core
  28. /// @file glm/detail/type_vec4.hpp
  29. /// @date 2008-08-22 / 2011-06-15
  30. /// @author Christophe Riccio
  31. ///////////////////////////////////////////////////////////////////////////////////
  32. #pragma once
  33. //#include "../fwd.hpp"
  34. #include "setup.hpp"
  35. #include "type_vec.hpp"
  36. #ifdef GLM_SWIZZLE
  37. # if GLM_HAS_ANONYMOUS_UNION
  38. # include "_swizzle.hpp"
  39. # else
  40. # include "_swizzle_func.hpp"
  41. # endif
  42. #endif //GLM_SWIZZLE
  43. #include <cstddef>
  44. namespace glm{
  45. namespace detail
  46. {
  47. template <typename T>
  48. struct simd
  49. {
  50. typedef T type[4];
  51. };
  52. # define GLM_NOT_BUGGY_VC32BITS !(GLM_MODEL == GLM_MODEL_32 && GLM_COMPILER & GLM_COMPILER_VC && GLM_COMPILER < GLM_COMPILER_VC2013)
  53. # if GLM_ARCH & GLM_ARCH_SSE2 && GLM_NOT_BUGGY_VC32BITS
  54. template <>
  55. struct simd<float>
  56. {
  57. typedef __m128 type;
  58. };
  59. template <>
  60. struct simd<int>
  61. {
  62. typedef __m128i type;
  63. };
  64. template <>
  65. struct simd<unsigned int>
  66. {
  67. typedef __m128i type;
  68. };
  69. # endif
  70. # if GLM_ARCH & GLM_ARCH_AVX && GLM_NOT_BUGGY_VC32BITS
  71. template <>
  72. struct simd<double>
  73. {
  74. typedef __m256d type;
  75. };
  76. # endif
  77. # if GLM_ARCH & GLM_ARCH_AVX2 && GLM_NOT_BUGGY_VC32BITS
  78. template <>
  79. struct simd<int64>
  80. {
  81. typedef __m256i type;
  82. };
  83. template <>
  84. struct simd<uint64>
  85. {
  86. typedef __m256i type;
  87. };
  88. # endif
  89. }//namespace detail
  90. template <typename T, precision P = defaultp>
  91. struct tvec4
  92. {
  93. //////////////////////////////////////
  94. // Implementation detail
  95. typedef tvec4<T, P> type;
  96. typedef tvec4<bool, P> bool_type;
  97. typedef T value_type;
  98. //////////////////////////////////////
  99. // Data
  100. # if GLM_HAS_ANONYMOUS_UNION
  101. union
  102. {
  103. struct { T x, y, z, w;};
  104. struct { T r, g, b, a; };
  105. struct { T s, t, p, q; };
  106. typename detail::simd<T>::type data;
  107. # ifdef GLM_SWIZZLE
  108. _GLM_SWIZZLE4_2_MEMBERS(T, P, tvec2, x, y, z, w)
  109. _GLM_SWIZZLE4_2_MEMBERS(T, P, tvec2, r, g, b, a)
  110. _GLM_SWIZZLE4_2_MEMBERS(T, P, tvec2, s, t, p, q)
  111. _GLM_SWIZZLE4_3_MEMBERS(T, P, tvec3, x, y, z, w)
  112. _GLM_SWIZZLE4_3_MEMBERS(T, P, tvec3, r, g, b, a)
  113. _GLM_SWIZZLE4_3_MEMBERS(T, P, tvec3, s, t, p, q)
  114. _GLM_SWIZZLE4_4_MEMBERS(T, P, tvec4, x, y, z, w)
  115. _GLM_SWIZZLE4_4_MEMBERS(T, P, tvec4, r, g, b, a)
  116. _GLM_SWIZZLE4_4_MEMBERS(T, P, tvec4, s, t, p, q)
  117. # endif//GLM_SWIZZLE
  118. };
  119. # else
  120. union { T x, r, s; };
  121. union { T y, g, t; };
  122. union { T z, b, p; };
  123. union { T w, a, q; };
  124. # ifdef GLM_SWIZZLE
  125. GLM_SWIZZLE_GEN_VEC_FROM_VEC4(T, P, tvec4, tvec2, tvec3, tvec4)
  126. # endif//GLM_SWIZZLE
  127. # endif//GLM_LANG
  128. //////////////////////////////////////
  129. // Component accesses
  130. # ifdef GLM_FORCE_SIZE_FUNC
  131. /// Return the count of components of the vector
  132. typedef size_t size_type;
  133. GLM_FUNC_DECL GLM_CONSTEXPR size_type size() const;
  134. GLM_FUNC_DECL T & operator[](size_type i);
  135. GLM_FUNC_DECL T const & operator[](size_type i) const;
  136. # else
  137. /// Return the count of components of the vector
  138. typedef length_t length_type;
  139. GLM_FUNC_DECL GLM_CONSTEXPR length_type length() const;
  140. GLM_FUNC_DECL T & operator[](length_type i);
  141. GLM_FUNC_DECL T const & operator[](length_type i) const;
  142. # endif//GLM_FORCE_SIZE_FUNC
  143. //////////////////////////////////////
  144. // Implicit basic constructors
  145. GLM_FUNC_DECL tvec4();
  146. template <precision Q>
  147. GLM_FUNC_DECL tvec4(tvec4<T, Q> const & v);
  148. //////////////////////////////////////
  149. // Explicit basic constructors
  150. GLM_FUNC_DECL explicit tvec4(ctor);
  151. GLM_FUNC_DECL explicit tvec4(T s);
  152. GLM_FUNC_DECL tvec4(T a, T b, T c, T d);
  153. GLM_FUNC_DECL ~tvec4(){}
  154. //////////////////////////////////////
  155. // Conversion scalar constructors
  156. /// Explicit converions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
  157. template <typename A, typename B, typename C, typename D>
  158. GLM_FUNC_DECL tvec4(A a, B b, C c, D d);
  159. template <typename A, typename B, typename C, typename D>
  160. GLM_FUNC_DECL tvec4(tvec1<A, P> const & a, tvec1<B, P> const & b, tvec1<C, P> const & c, tvec1<D, P> const & d);
  161. //////////////////////////////////////
  162. // Conversion vector constructors
  163. //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
  164. template <typename A, typename B, typename C, precision Q>
  165. GLM_FUNC_DECL explicit tvec4(tvec2<A, Q> const & a, B b, C c);
  166. //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
  167. template <typename A, typename B, typename C, precision Q>
  168. GLM_FUNC_DECL explicit tvec4(tvec2<A, Q> const & a, tvec1<B, Q> const & b, tvec1<C, Q> const & c);
  169. //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
  170. template <typename A, typename B, typename C, precision Q>
  171. GLM_FUNC_DECL explicit tvec4(A a, tvec2<B, Q> const & b, C c);
  172. //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
  173. template <typename A, typename B, typename C, precision Q>
  174. GLM_FUNC_DECL explicit tvec4(tvec1<A, Q> const & a, tvec2<B, Q> const & b, tvec1<C, Q> const & c);
  175. //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
  176. template <typename A, typename B, typename C, precision Q>
  177. GLM_FUNC_DECL explicit tvec4(A a, B b, tvec2<C, Q> const & c);
  178. //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
  179. template <typename A, typename B, typename C, precision Q>
  180. GLM_FUNC_DECL explicit tvec4(tvec1<A, Q> const & a, tvec1<B, Q> const & b, tvec2<C, Q> const & c);
  181. //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
  182. template <typename A, typename B, precision Q>
  183. GLM_FUNC_DECL explicit tvec4(tvec3<A, Q> const & a, B b);
  184. //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
  185. template <typename A, typename B, precision Q>
  186. GLM_FUNC_DECL explicit tvec4(tvec3<A, Q> const & a, tvec1<B, Q> const & b);
  187. //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
  188. template <typename A, typename B, precision Q>
  189. GLM_FUNC_DECL explicit tvec4(A a, tvec3<B, Q> const & b);
  190. //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
  191. template <typename A, typename B, precision Q>
  192. GLM_FUNC_DECL explicit tvec4(tvec1<A, Q> const & a, tvec3<B, Q> const & b);
  193. //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
  194. template <typename A, typename B, precision Q>
  195. GLM_FUNC_DECL explicit tvec4(tvec2<A, Q> const & a, tvec2<B, Q> const & b);
  196. # ifdef GLM_FORCE_EXPLICIT_CTOR
  197. //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
  198. template <typename U, precision Q>
  199. GLM_FUNC_DECL explicit tvec4(tvec4<U, Q> const & v);
  200. # else
  201. //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
  202. template <typename U, precision Q>
  203. GLM_FUNC_DECL tvec4(tvec4<U, Q> const & v);
  204. # endif
  205. //////////////////////////////////////
  206. // Swizzle constructors
  207. # if GLM_HAS_ANONYMOUS_UNION && defined(GLM_SWIZZLE)
  208. template <int E0, int E1, int E2, int E3>
  209. GLM_FUNC_DECL tvec4(detail::_swizzle<4, T, P, tvec4<T, P>, E0, E1, E2, E3> const & that)
  210. {
  211. *this = that();
  212. }
  213. template <int E0, int E1, int F0, int F1>
  214. GLM_FUNC_DECL tvec4(detail::_swizzle<2, T, P, tvec2<T, P>, E0, E1, -1, -2> const & v, detail::_swizzle<2, T, P, tvec2<T, P>, F0, F1, -1, -2> const & u)
  215. {
  216. *this = tvec4<T, P>(v(), u());
  217. }
  218. template <int E0, int E1>
  219. GLM_FUNC_DECL tvec4(T const & x, T const & y, detail::_swizzle<2, T, P, tvec2<T, P>, E0, E1, -1, -2> const & v)
  220. {
  221. *this = tvec4<T, P>(x, y, v());
  222. }
  223. template <int E0, int E1>
  224. GLM_FUNC_DECL tvec4(T const & x, detail::_swizzle<2, T, P, tvec2<T, P>, E0, E1, -1, -2> const & v, T const & w)
  225. {
  226. *this = tvec4<T, P>(x, v(), w);
  227. }
  228. template <int E0, int E1>
  229. GLM_FUNC_DECL tvec4(detail::_swizzle<2, T, P, tvec2<T, P>, E0, E1, -1, -2> const & v, T const & z, T const & w)
  230. {
  231. *this = tvec4<T, P>(v(), z, w);
  232. }
  233. template <int E0, int E1, int E2>
  234. GLM_FUNC_DECL tvec4(detail::_swizzle<3, T, P, tvec3<T, P>, E0, E1, E2, -1> const & v, T const & w)
  235. {
  236. *this = tvec4<T, P>(v(), w);
  237. }
  238. template <int E0, int E1, int E2>
  239. GLM_FUNC_DECL tvec4(T const & x, detail::_swizzle<3, T, P, tvec3<T, P>, E0, E1, E2, -1> const & v)
  240. {
  241. *this = tvec4<T, P>(x, v());
  242. }
  243. # endif// GLM_HAS_ANONYMOUS_UNION && defined(GLM_SWIZZLE)
  244. //////////////////////////////////////
  245. // Unary arithmetic operators
  246. template <typename U>
  247. GLM_FUNC_DECL tvec4<T, P> & operator=(tvec4<U, P> const & v);
  248. template <typename U>
  249. GLM_FUNC_DECL tvec4<T, P> & operator+=(U scalar);
  250. template <typename U>
  251. GLM_FUNC_DECL tvec4<T, P> & operator+=(tvec1<U, P> const & v);
  252. template <typename U>
  253. GLM_FUNC_DECL tvec4<T, P> & operator+=(tvec4<U, P> const & v);
  254. template <typename U>
  255. GLM_FUNC_DECL tvec4<T, P> & operator-=(U scalar);
  256. template <typename U>
  257. GLM_FUNC_DECL tvec4<T, P> & operator-=(tvec1<U, P> const & v);
  258. template <typename U>
  259. GLM_FUNC_DECL tvec4<T, P> & operator-=(tvec4<U, P> const & v);
  260. template <typename U>
  261. GLM_FUNC_DECL tvec4<T, P> & operator*=(U scalar);
  262. template <typename U>
  263. GLM_FUNC_DECL tvec4<T, P> & operator*=(tvec1<U, P> const & v);
  264. template <typename U>
  265. GLM_FUNC_DECL tvec4<T, P> & operator*=(tvec4<U, P> const & v);
  266. template <typename U>
  267. GLM_FUNC_DECL tvec4<T, P> & operator/=(U scalar);
  268. template <typename U>
  269. GLM_FUNC_DECL tvec4<T, P> & operator/=(tvec1<U, P> const & v);
  270. template <typename U>
  271. GLM_FUNC_DECL tvec4<T, P> & operator/=(tvec4<U, P> const & v);
  272. //////////////////////////////////////
  273. // Increment and decrement operators
  274. GLM_FUNC_DECL tvec4<T, P> & operator++();
  275. GLM_FUNC_DECL tvec4<T, P> & operator--();
  276. GLM_FUNC_DECL tvec4<T, P> operator++(int);
  277. GLM_FUNC_DECL tvec4<T, P> operator--(int);
  278. //////////////////////////////////////
  279. // Unary bit operators
  280. template <typename U>
  281. GLM_FUNC_DECL tvec4<T, P> & operator%=(U scalar);
  282. template <typename U>
  283. GLM_FUNC_DECL tvec4<T, P> & operator%=(tvec1<U, P> const & v);
  284. template <typename U>
  285. GLM_FUNC_DECL tvec4<T, P> & operator%=(tvec4<U, P> const & v);
  286. template <typename U>
  287. GLM_FUNC_DECL tvec4<T, P> & operator&=(U scalar);
  288. template <typename U>
  289. GLM_FUNC_DECL tvec4<T, P> & operator&=(tvec1<U, P> const & v);
  290. template <typename U>
  291. GLM_FUNC_DECL tvec4<T, P> & operator&=(tvec4<U, P> const & v);
  292. template <typename U>
  293. GLM_FUNC_DECL tvec4<T, P> & operator|=(U scalar);
  294. template <typename U>
  295. GLM_FUNC_DECL tvec4<T, P> & operator|=(tvec1<U, P> const & v);
  296. template <typename U>
  297. GLM_FUNC_DECL tvec4<T, P> & operator|=(tvec4<U, P> const & v);
  298. template <typename U>
  299. GLM_FUNC_DECL tvec4<T, P> & operator^=(U scalar);
  300. template <typename U>
  301. GLM_FUNC_DECL tvec4<T, P> & operator^=(tvec1<U, P> const & v);
  302. template <typename U>
  303. GLM_FUNC_DECL tvec4<T, P> & operator^=(tvec4<U, P> const & v);
  304. template <typename U>
  305. GLM_FUNC_DECL tvec4<T, P> & operator<<=(U scalar);
  306. template <typename U>
  307. GLM_FUNC_DECL tvec4<T, P> & operator<<=(tvec1<U, P> const & v);
  308. template <typename U>
  309. GLM_FUNC_DECL tvec4<T, P> & operator<<=(tvec4<U, P> const & v);
  310. template <typename U>
  311. GLM_FUNC_DECL tvec4<T, P> & operator>>=(U scalar);
  312. template <typename U>
  313. GLM_FUNC_DECL tvec4<T, P> & operator>>=(tvec1<U, P> const & v);
  314. template <typename U>
  315. GLM_FUNC_DECL tvec4<T, P> & operator>>=(tvec4<U, P> const & v);
  316. };
  317. template <typename T, precision P>
  318. GLM_FUNC_DECL tvec4<T, P> operator+(tvec4<T, P> const & v, T scalar);
  319. template <typename T, precision P>
  320. GLM_FUNC_DECL tvec4<T, P> operator+(tvec4<T, P> const & v, tvec1<T, P> const & s);
  321. template <typename T, precision P>
  322. GLM_FUNC_DECL tvec4<T, P> operator+(T scalar, tvec4<T, P> const & v);
  323. template <typename T, precision P>
  324. GLM_FUNC_DECL tvec4<T, P> operator+(tvec1<T, P> const & s, tvec4<T, P> const & v);
  325. template <typename T, precision P>
  326. GLM_FUNC_DECL tvec4<T, P> operator+(tvec4<T, P> const & v1, tvec4<T, P> const & v2);
  327. template <typename T, precision P>
  328. GLM_FUNC_DECL tvec4<T, P> operator-(tvec4<T, P> const & v, T scalar);
  329. template <typename T, precision P>
  330. GLM_FUNC_DECL tvec4<T, P> operator-(tvec4<T, P> const & v, tvec1<T, P> const & s);
  331. template <typename T, precision P>
  332. GLM_FUNC_DECL tvec4<T, P> operator-(T scalar, tvec4<T, P> const & v);
  333. template <typename T, precision P>
  334. GLM_FUNC_DECL tvec4<T, P> operator-(tvec1<T, P> const & s, tvec4<T, P> const & v);
  335. template <typename T, precision P>
  336. GLM_FUNC_DECL tvec4<T, P> operator-(tvec4<T, P> const & v1, tvec4<T, P> const & v2);
  337. template <typename T, precision P>
  338. GLM_FUNC_DECL tvec4<T, P> operator*(tvec4<T, P> const & v, T scalar);
  339. template <typename T, precision P>
  340. GLM_FUNC_DECL tvec4<T, P> operator*(tvec4<T, P> const & v, tvec1<T, P> const & s);
  341. template <typename T, precision P>
  342. GLM_FUNC_DECL tvec4<T, P> operator*(T scalar, tvec4<T, P> const & v);
  343. template <typename T, precision P>
  344. GLM_FUNC_DECL tvec4<T, P> operator*(tvec1<T, P> const & s, tvec4<T, P> const & v);
  345. template <typename T, precision P>
  346. GLM_FUNC_DECL tvec4<T, P> operator*(tvec4<T, P> const & v1, tvec4<T, P> const & v2);
  347. template <typename T, precision P>
  348. GLM_FUNC_DECL tvec4<T, P> operator/(tvec4<T, P> const & v, T scalar);
  349. template <typename T, precision P>
  350. GLM_FUNC_DECL tvec4<T, P> operator/(tvec4<T, P> const & v, tvec1<T, P> const & s);
  351. template <typename T, precision P>
  352. GLM_FUNC_DECL tvec4<T, P> operator/(T scalar, tvec4<T, P> const & v);
  353. template <typename T, precision P>
  354. GLM_FUNC_DECL tvec4<T, P> operator/(tvec1<T, P> const & s, tvec4<T, P> const & v);
  355. template <typename T, precision P>
  356. GLM_FUNC_DECL tvec4<T, P> operator/(tvec4<T, P> const & v1, tvec4<T, P> const & v2);
  357. template <typename T, precision P>
  358. GLM_FUNC_DECL tvec4<T, P> operator-(tvec4<T, P> const & v);
  359. template <typename T, precision P>
  360. GLM_FUNC_DECL bool operator==(tvec4<T, P> const & v1, tvec4<T, P> const & v2);
  361. template <typename T, precision P>
  362. GLM_FUNC_DECL bool operator!=(tvec4<T, P> const & v1, tvec4<T, P> const & v2);
  363. template <typename T, precision P>
  364. GLM_FUNC_DECL tvec4<T, P> operator%(tvec4<T, P> const & v, T scalar);
  365. template <typename T, precision P>
  366. GLM_FUNC_DECL tvec4<T, P> operator%(tvec4<T, P> const & v, tvec1<T, P> const & s);
  367. template <typename T, precision P>
  368. GLM_FUNC_DECL tvec4<T, P> operator%(T scalar, tvec4<T, P> const & v);
  369. template <typename T, precision P>
  370. GLM_FUNC_DECL tvec4<T, P> operator%(tvec1<T, P> const & s, tvec4<T, P> const & v);
  371. template <typename T, precision P>
  372. GLM_FUNC_DECL tvec4<T, P> operator%(tvec4<T, P> const & v1, tvec4<T, P> const & v2);
  373. template <typename T, precision P>
  374. GLM_FUNC_DECL tvec4<T, P> operator&(tvec4<T, P> const & v, T scalar);
  375. template <typename T, precision P>
  376. GLM_FUNC_DECL tvec4<T, P> operator&(tvec4<T, P> const & v, tvec1<T, P> const & s);
  377. template <typename T, precision P>
  378. GLM_FUNC_DECL tvec4<T, P> operator&(T scalar, tvec4<T, P> const & v);
  379. template <typename T, precision P>
  380. GLM_FUNC_DECL tvec4<T, P> operator&(tvec1<T, P> const & s, tvec4<T, P> const & v);
  381. template <typename T, precision P>
  382. GLM_FUNC_DECL tvec4<T, P> operator&(tvec4<T, P> const & v1, tvec4<T, P> const & v2);
  383. template <typename T, precision P>
  384. GLM_FUNC_DECL tvec4<T, P> operator|(tvec4<T, P> const & v, T scalar);
  385. template <typename T, precision P>
  386. GLM_FUNC_DECL tvec4<T, P> operator|(tvec4<T, P> const & v, tvec1<T, P> const & s);
  387. template <typename T, precision P>
  388. GLM_FUNC_DECL tvec4<T, P> operator|(T scalar, tvec4<T, P> const & v);
  389. template <typename T, precision P>
  390. GLM_FUNC_DECL tvec4<T, P> operator|(tvec1<T, P> const & s, tvec4<T, P> const & v);
  391. template <typename T, precision P>
  392. GLM_FUNC_DECL tvec4<T, P> operator|(tvec4<T, P> const & v1, tvec4<T, P> const & v2);
  393. template <typename T, precision P>
  394. GLM_FUNC_DECL tvec4<T, P> operator^(tvec4<T, P> const & v, T scalar);
  395. template <typename T, precision P>
  396. GLM_FUNC_DECL tvec4<T, P> operator^(tvec4<T, P> const & v, tvec1<T, P> const & s);
  397. template <typename T, precision P>
  398. GLM_FUNC_DECL tvec4<T, P> operator^(T scalar, tvec4<T, P> const & v);
  399. template <typename T, precision P>
  400. GLM_FUNC_DECL tvec4<T, P> operator^(tvec1<T, P> const & s, tvec4<T, P> const & v);
  401. template <typename T, precision P>
  402. GLM_FUNC_DECL tvec4<T, P> operator^(tvec4<T, P> const & v1, tvec4<T, P> const & v2);
  403. template <typename T, precision P>
  404. GLM_FUNC_DECL tvec4<T, P> operator<<(tvec4<T, P> const & v, T scalar);
  405. template <typename T, precision P>
  406. GLM_FUNC_DECL tvec4<T, P> operator<<(tvec4<T, P> const & v, tvec1<T, P> const & s);
  407. template <typename T, precision P>
  408. GLM_FUNC_DECL tvec4<T, P> operator<<(T scalar, tvec4<T, P> const & v);
  409. template <typename T, precision P>
  410. GLM_FUNC_DECL tvec4<T, P> operator<<(tvec1<T, P> const & s, tvec4<T, P> const & v);
  411. template <typename T, precision P>
  412. GLM_FUNC_DECL tvec4<T, P> operator<<(tvec4<T, P> const & v1, tvec4<T, P> const & v2);
  413. template <typename T, precision P>
  414. GLM_FUNC_DECL tvec4<T, P> operator>>(tvec4<T, P> const & v, T scalar);
  415. template <typename T, precision P>
  416. GLM_FUNC_DECL tvec4<T, P> operator>>(tvec4<T, P> const & v, tvec1<T, P> const & s);
  417. template <typename T, precision P>
  418. GLM_FUNC_DECL tvec4<T, P> operator>>(T scalar, tvec4<T, P> const & v);
  419. template <typename T, precision P>
  420. GLM_FUNC_DECL tvec4<T, P> operator>>(tvec1<T, P> const & s, tvec4<T, P> const & v);
  421. template <typename T, precision P>
  422. GLM_FUNC_DECL tvec4<T, P> operator>>(tvec4<T, P> const & v1, tvec4<T, P> const & v2);
  423. template <typename T, precision P>
  424. GLM_FUNC_DECL tvec4<T, P> operator~(tvec4<T, P> const & v);
  425. }//namespace glm
  426. #ifndef GLM_EXTERNAL_TEMPLATE
  427. #include "type_vec4.inl"
  428. #endif//GLM_EXTERNAL_TEMPLATE