19cc421eb545767e22fd723dc573a7a3225261b1cCourtney Goeltzenleuchter/////////////////////////////////////////////////////////////////////////////////// 2d0d7ccc3f23046c7610a561e3eb99bb71eb5bd60Courtney Goeltzenleuchter/// OpenGL Mathematics (glm.g-truc.net) 3d0d7ccc3f23046c7610a561e3eb99bb71eb5bd60Courtney Goeltzenleuchter/// 4d0d7ccc3f23046c7610a561e3eb99bb71eb5bd60Courtney Goeltzenleuchter/// Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net) 5d0d7ccc3f23046c7610a561e3eb99bb71eb5bd60Courtney Goeltzenleuchter/// Permission is hereby granted, free of charge, to any person obtaining a copy 6d0d7ccc3f23046c7610a561e3eb99bb71eb5bd60Courtney Goeltzenleuchter/// of this software and associated documentation files (the "Software"), to deal 7d0d7ccc3f23046c7610a561e3eb99bb71eb5bd60Courtney Goeltzenleuchter/// in the Software without restriction, including without limitation the rights 8d0d7ccc3f23046c7610a561e3eb99bb71eb5bd60Courtney Goeltzenleuchter/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9d0d7ccc3f23046c7610a561e3eb99bb71eb5bd60Courtney Goeltzenleuchter/// copies of the Software, and to permit persons to whom the Software is 10d0d7ccc3f23046c7610a561e3eb99bb71eb5bd60Courtney Goeltzenleuchter/// furnished to do so, subject to the following conditions: 11d0d7ccc3f23046c7610a561e3eb99bb71eb5bd60Courtney Goeltzenleuchter/// 12d0d7ccc3f23046c7610a561e3eb99bb71eb5bd60Courtney Goeltzenleuchter/// The above copyright notice and this permission notice shall be included in 13d0d7ccc3f23046c7610a561e3eb99bb71eb5bd60Courtney Goeltzenleuchter/// all copies or substantial portions of the Software. 14d0d7ccc3f23046c7610a561e3eb99bb71eb5bd60Courtney Goeltzenleuchter/// 15d0d7ccc3f23046c7610a561e3eb99bb71eb5bd60Courtney Goeltzenleuchter/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16d0d7ccc3f23046c7610a561e3eb99bb71eb5bd60Courtney Goeltzenleuchter/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17d0d7ccc3f23046c7610a561e3eb99bb71eb5bd60Courtney Goeltzenleuchter/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18d0d7ccc3f23046c7610a561e3eb99bb71eb5bd60Courtney Goeltzenleuchter/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19d0d7ccc3f23046c7610a561e3eb99bb71eb5bd60Courtney Goeltzenleuchter/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20d0d7ccc3f23046c7610a561e3eb99bb71eb5bd60Courtney Goeltzenleuchter/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21d0d7ccc3f23046c7610a561e3eb99bb71eb5bd60Courtney Goeltzenleuchter/// THE SOFTWARE. 22d0d7ccc3f23046c7610a561e3eb99bb71eb5bd60Courtney Goeltzenleuchter/// 239cc421eb545767e22fd723dc573a7a3225261b1cCourtney Goeltzenleuchter/// @ref core 249cc421eb545767e22fd723dc573a7a3225261b1cCourtney Goeltzenleuchter/// @file glm/core/type_mat2x4.hpp 25d0d7ccc3f23046c7610a561e3eb99bb71eb5bd60Courtney Goeltzenleuchter/// @date 2006-08-05 / 2011-06-15 26d0d7ccc3f23046c7610a561e3eb99bb71eb5bd60Courtney Goeltzenleuchter/// @author Christophe Riccio 27eb9130e35f3301cefaa546e56176e747065bc283Cody Northrop/////////////////////////////////////////////////////////////////////////////////// 28f4b83ed12f844daf00a29ceb003538c9c8ffbb11GregF 29d4e020aa1921643b14a3a546f6807afbafa7629eCody Northrop#ifndef glm_core_type_mat2x4 3013ecdcd44b370d5f16c5977e902bed90b27f3669Chia-I Wu#define glm_core_type_mat2x4 319cc421eb545767e22fd723dc573a7a3225261b1cCourtney Goeltzenleuchter 32ef20d32f44141f8bcee9a77a03100f2c33e7a71fTony Barbour#include "../fwd.hpp" 33d0d7ccc3f23046c7610a561e3eb99bb71eb5bd60Courtney Goeltzenleuchter#include "type_vec2.hpp" 34d0d7ccc3f23046c7610a561e3eb99bb71eb5bd60Courtney Goeltzenleuchter#include "type_vec4.hpp" 35d0d7ccc3f23046c7610a561e3eb99bb71eb5bd60Courtney Goeltzenleuchter#include "type_mat.hpp" 36d0d7ccc3f23046c7610a561e3eb99bb71eb5bd60Courtney Goeltzenleuchter#include <limits> 37d0d7ccc3f23046c7610a561e3eb99bb71eb5bd60Courtney Goeltzenleuchter 38d0d7ccc3f23046c7610a561e3eb99bb71eb5bd60Courtney Goeltzenleuchternamespace glm{ 39d0d7ccc3f23046c7610a561e3eb99bb71eb5bd60Courtney Goeltzenleuchternamespace detail 40d0d7ccc3f23046c7610a561e3eb99bb71eb5bd60Courtney Goeltzenleuchter{ 4128d3396d74d859bed93a17b423514e1041148824Courtney Goeltzenleuchter template <typename T, precision P> 4225e3b839ae203c18a71ff950711137d9e753b2eeTony Barbour struct tmat2x4 4325e3b839ae203c18a71ff950711137d9e753b2eeTony Barbour { 4425e3b839ae203c18a71ff950711137d9e753b2eeTony Barbour enum ctor{_null}; 4525e3b839ae203c18a71ff950711137d9e753b2eeTony Barbour typedef T value_type; 4625e3b839ae203c18a71ff950711137d9e753b2eeTony Barbour typedef std::size_t size_type; 4722a30866de6210d780995dfaaae39f1a73115aa0Tony Barbour typedef tvec4<T, P> col_type; 4822a30866de6210d780995dfaaae39f1a73115aa0Tony Barbour typedef tvec2<T, P> row_type; 4922a30866de6210d780995dfaaae39f1a73115aa0Tony Barbour typedef tmat2x4<T, P> type; 5022a30866de6210d780995dfaaae39f1a73115aa0Tony Barbour typedef tmat4x2<T, P> transpose_type; 5122a30866de6210d780995dfaaae39f1a73115aa0Tony Barbour 5222a30866de6210d780995dfaaae39f1a73115aa0Tony Barbour GLM_FUNC_DECL GLM_CONSTEXPR length_t length() const; 5328d3396d74d859bed93a17b423514e1041148824Courtney Goeltzenleuchter 5428d3396d74d859bed93a17b423514e1041148824Courtney Goeltzenleuchter private: 5528d3396d74d859bed93a17b423514e1041148824Courtney Goeltzenleuchter // Data 56d0d7ccc3f23046c7610a561e3eb99bb71eb5bd60Courtney Goeltzenleuchter col_type value[2]; 57d0d7ccc3f23046c7610a561e3eb99bb71eb5bd60Courtney Goeltzenleuchter 580199918cdd982ea192f737dc8660be1c33883e68Tony Barbour public: 5913ecdcd44b370d5f16c5977e902bed90b27f3669Chia-I Wu // Constructors 60ef20d32f44141f8bcee9a77a03100f2c33e7a71fTony Barbour GLM_FUNC_DECL tmat2x4(); 610199918cdd982ea192f737dc8660be1c33883e68Tony Barbour GLM_FUNC_DECL tmat2x4(tmat2x4<T, P> const & m); 62d0d7ccc3f23046c7610a561e3eb99bb71eb5bd60Courtney Goeltzenleuchter template <precision Q> 63d0d7ccc3f23046c7610a561e3eb99bb71eb5bd60Courtney Goeltzenleuchter GLM_FUNC_DECL tmat2x4(tmat2x4<T, Q> const & m); 640199918cdd982ea192f737dc8660be1c33883e68Tony Barbour 650199918cdd982ea192f737dc8660be1c33883e68Tony Barbour GLM_FUNC_DECL explicit tmat2x4( 660199918cdd982ea192f737dc8660be1c33883e68Tony Barbour ctor); 670199918cdd982ea192f737dc8660be1c33883e68Tony Barbour GLM_FUNC_DECL explicit tmat2x4( 680199918cdd982ea192f737dc8660be1c33883e68Tony Barbour T const & s); 690199918cdd982ea192f737dc8660be1c33883e68Tony Barbour GLM_FUNC_DECL tmat2x4( 70d0d7ccc3f23046c7610a561e3eb99bb71eb5bd60Courtney Goeltzenleuchter T const & x0, T const & y0, T const & z0, T const & w0, 71ef20d32f44141f8bcee9a77a03100f2c33e7a71fTony Barbour T const & x1, T const & y1, T const & z1, T const & w1); 72ef20d32f44141f8bcee9a77a03100f2c33e7a71fTony Barbour GLM_FUNC_DECL tmat2x4( 73ef20d32f44141f8bcee9a77a03100f2c33e7a71fTony Barbour col_type const & v0, 74ef20d32f44141f8bcee9a77a03100f2c33e7a71fTony Barbour col_type const & v1); 75ef20d32f44141f8bcee9a77a03100f2c33e7a71fTony Barbour 76d0d7ccc3f23046c7610a561e3eb99bb71eb5bd60Courtney Goeltzenleuchter ////////////////////////////////////// 77d0d7ccc3f23046c7610a561e3eb99bb71eb5bd60Courtney Goeltzenleuchter // Conversions 780199918cdd982ea192f737dc8660be1c33883e68Tony Barbour template < 79d0d7ccc3f23046c7610a561e3eb99bb71eb5bd60Courtney Goeltzenleuchter typename X1, typename Y1, typename Z1, typename W1, 80d0d7ccc3f23046c7610a561e3eb99bb71eb5bd60Courtney Goeltzenleuchter typename X2, typename Y2, typename Z2, typename W2> 810199918cdd982ea192f737dc8660be1c33883e68Tony Barbour GLM_FUNC_DECL tmat2x4( 820199918cdd982ea192f737dc8660be1c33883e68Tony Barbour X1 const & x1, Y1 const & y1, Z1 const & z1, W1 const & w1, 83d0d7ccc3f23046c7610a561e3eb99bb71eb5bd60Courtney Goeltzenleuchter X2 const & x2, Y2 const & y2, Z2 const & z2, W2 const & w2); 841cfbd172f5e4f376d2e18ab079317b5e955cddf7Cody Northrop 85d0d7ccc3f23046c7610a561e3eb99bb71eb5bd60Courtney Goeltzenleuchter template <typename U, typename V> 8625e3b839ae203c18a71ff950711137d9e753b2eeTony Barbour GLM_FUNC_DECL tmat2x4( 87d0d7ccc3f23046c7610a561e3eb99bb71eb5bd60Courtney Goeltzenleuchter tvec4<U, P> const & v1, 88d0d7ccc3f23046c7610a561e3eb99bb71eb5bd60Courtney Goeltzenleuchter tvec4<V, P> const & v2); 890199918cdd982ea192f737dc8660be1c33883e68Tony Barbour 900199918cdd982ea192f737dc8660be1c33883e68Tony Barbour ////////////////////////////////////// 910199918cdd982ea192f737dc8660be1c33883e68Tony Barbour // Matrix conversions 920199918cdd982ea192f737dc8660be1c33883e68Tony Barbour template <typename U, precision Q> 930199918cdd982ea192f737dc8660be1c33883e68Tony Barbour GLM_FUNC_DECL explicit tmat2x4(tmat2x4<U, Q> const & m); 948205d901f17b1c76d89c956be235cf4e7a20a546Tony Barbour 95941920311fa71077ea5b2c2a3b3a05bc579f219bCourtney Goeltzenleuchter GLM_FUNC_DECL explicit tmat2x4(tmat2x2<T, P> const & x); 96acfb0491b89d57c3915f661edaad114d64d87386Cody Northrop GLM_FUNC_DECL explicit tmat2x4(tmat3x3<T, P> const & x); 971cfbd172f5e4f376d2e18ab079317b5e955cddf7Cody Northrop GLM_FUNC_DECL explicit tmat2x4(tmat4x4<T, P> const & x); 98eb9130e35f3301cefaa546e56176e747065bc283Cody Northrop GLM_FUNC_DECL explicit tmat2x4(tmat2x3<T, P> const & x); 99eb9130e35f3301cefaa546e56176e747065bc283Cody Northrop GLM_FUNC_DECL explicit tmat2x4(tmat3x2<T, P> const & x); 100eb9130e35f3301cefaa546e56176e747065bc283Cody Northrop GLM_FUNC_DECL explicit tmat2x4(tmat3x4<T, P> const & x); 101d0d7ccc3f23046c7610a561e3eb99bb71eb5bd60Courtney Goeltzenleuchter GLM_FUNC_DECL explicit tmat2x4(tmat4x2<T, P> const & x); 1025c25faa269dc9187e7a82bcb08f93d87e13a1c52Courtney Goeltzenleuchter GLM_FUNC_DECL explicit tmat2x4(tmat4x3<T, P> const & x); 1035c25faa269dc9187e7a82bcb08f93d87e13a1c52Courtney Goeltzenleuchter 1045c25faa269dc9187e7a82bcb08f93d87e13a1c52Courtney Goeltzenleuchter // Accesses 105d0d7ccc3f23046c7610a561e3eb99bb71eb5bd60Courtney Goeltzenleuchter GLM_FUNC_DECL col_type & operator[](length_t i); 106941920311fa71077ea5b2c2a3b3a05bc579f219bCourtney Goeltzenleuchter GLM_FUNC_DECL col_type const & operator[](length_t i) const; 107941920311fa71077ea5b2c2a3b3a05bc579f219bCourtney Goeltzenleuchter 108941920311fa71077ea5b2c2a3b3a05bc579f219bCourtney Goeltzenleuchter // Unary updatable operators 109941920311fa71077ea5b2c2a3b3a05bc579f219bCourtney Goeltzenleuchter GLM_FUNC_DECL tmat2x4<T, P>& operator= (tmat2x4<T, P> const & m); 110941920311fa71077ea5b2c2a3b3a05bc579f219bCourtney Goeltzenleuchter template <typename U> 111941920311fa71077ea5b2c2a3b3a05bc579f219bCourtney Goeltzenleuchter GLM_FUNC_DECL tmat2x4<T, P>& operator= (tmat2x4<U, P> const & m); 1128205d901f17b1c76d89c956be235cf4e7a20a546Tony Barbour template <typename U> 113941920311fa71077ea5b2c2a3b3a05bc579f219bCourtney Goeltzenleuchter GLM_FUNC_DECL tmat2x4<T, P>& operator+= (U s); 114941920311fa71077ea5b2c2a3b3a05bc579f219bCourtney Goeltzenleuchter template <typename U> 115d0d7ccc3f23046c7610a561e3eb99bb71eb5bd60Courtney Goeltzenleuchter GLM_FUNC_DECL tmat2x4<T, P>& operator+= (tmat2x4<U, P> const & m); 116ef20d32f44141f8bcee9a77a03100f2c33e7a71fTony Barbour template <typename U> 117ef20d32f44141f8bcee9a77a03100f2c33e7a71fTony Barbour GLM_FUNC_DECL tmat2x4<T, P>& operator-= (U s); 118ef20d32f44141f8bcee9a77a03100f2c33e7a71fTony Barbour template <typename U> 11954d02cbdb80ccc4af41f5cacaa9b489071e0f45cCourtney Goeltzenleuchter GLM_FUNC_DECL tmat2x4<T, P>& operator-= (tmat2x4<U, P> const & m); 120ec69b9ccbadeabd878c375b04f94d126f6fb3bbaCourtney Goeltzenleuchter template <typename U> 1210199918cdd982ea192f737dc8660be1c33883e68Tony Barbour GLM_FUNC_DECL tmat2x4<T, P>& operator*= (U s); 122ef20d32f44141f8bcee9a77a03100f2c33e7a71fTony Barbour template <typename U> 123ef20d32f44141f8bcee9a77a03100f2c33e7a71fTony Barbour GLM_FUNC_DECL tmat2x4<T, P>& operator/= (U s); 124ef20d32f44141f8bcee9a77a03100f2c33e7a71fTony Barbour 125ef20d32f44141f8bcee9a77a03100f2c33e7a71fTony Barbour ////////////////////////////////////// 126ef20d32f44141f8bcee9a77a03100f2c33e7a71fTony Barbour // Increment and decrement operators 127ef20d32f44141f8bcee9a77a03100f2c33e7a71fTony Barbour 128ef20d32f44141f8bcee9a77a03100f2c33e7a71fTony Barbour GLM_FUNC_DECL tmat2x4<T, P> & operator++ (); 129ef20d32f44141f8bcee9a77a03100f2c33e7a71fTony Barbour GLM_FUNC_DECL tmat2x4<T, P> & operator-- (); 130ef20d32f44141f8bcee9a77a03100f2c33e7a71fTony Barbour GLM_FUNC_DECL tmat2x4<T, P> operator++(int); 131f12c776b6a2a9d8b314e38a1dfab1b2441e32867Courtney Goeltzenleuchter GLM_FUNC_DECL tmat2x4<T, P> operator--(int); 132f12c776b6a2a9d8b314e38a1dfab1b2441e32867Courtney Goeltzenleuchter }; 133f12c776b6a2a9d8b314e38a1dfab1b2441e32867Courtney Goeltzenleuchter 134f12c776b6a2a9d8b314e38a1dfab1b2441e32867Courtney Goeltzenleuchter // Binary operators 135f12c776b6a2a9d8b314e38a1dfab1b2441e32867Courtney Goeltzenleuchter 136f12c776b6a2a9d8b314e38a1dfab1b2441e32867Courtney Goeltzenleuchter template <typename T, precision P> 137f12c776b6a2a9d8b314e38a1dfab1b2441e32867Courtney Goeltzenleuchter GLM_FUNC_DECL tmat2x4<T, P> operator+ ( 138f12c776b6a2a9d8b314e38a1dfab1b2441e32867Courtney Goeltzenleuchter tmat2x4<T, P> const & m, 1399cc421eb545767e22fd723dc573a7a3225261b1cCourtney Goeltzenleuchter T const & s); 140 141 template <typename T, precision P> 142 GLM_FUNC_DECL tmat2x4<T, P> operator+ ( 143 tmat2x4<T, P> const & m1, 144 tmat2x4<T, P> const & m2); 145 146 template <typename T, precision P> 147 GLM_FUNC_DECL tmat2x4<T, P> operator- ( 148 tmat2x4<T, P> const & m, 149 T const & s); 150 151 template <typename T, precision P> 152 GLM_FUNC_DECL tmat2x4<T, P> operator- ( 153 tmat2x4<T, P> const & m1, 154 tmat2x4<T, P> const & m2); 155 156 template <typename T, precision P> 157 GLM_FUNC_DECL tmat2x4<T, P> operator* ( 158 tmat2x4<T, P> const & m, 159 T const & s); 160 161 template <typename T, precision P> 162 GLM_FUNC_DECL tmat2x4<T, P> operator* ( 163 T const & s, 164 tmat2x4<T, P> const & m); 165 166 template <typename T, precision P> 167 GLM_FUNC_DECL typename tmat2x4<T, P>::col_type operator* ( 168 tmat2x4<T, P> const & m, 169 typename tmat2x4<T, P>::row_type const & v); 170 171 template <typename T, precision P> 172 GLM_FUNC_DECL typename tmat2x4<T, P>::row_type operator* ( 173 typename tmat2x4<T, P>::col_type const & v, 174 tmat2x4<T, P> const & m); 175 176 template <typename T, precision P> 177 GLM_FUNC_DECL tmat4x4<T, P> operator* ( 178 tmat2x4<T, P> const & m1, 179 tmat4x2<T, P> const & m2); 180 181 template <typename T, precision P> 182 GLM_FUNC_DECL tmat2x4<T, P> operator* ( 183 tmat2x4<T, P> const & m1, 184 tmat2x2<T, P> const & m2); 185 186 template <typename T, precision P> 187 GLM_FUNC_DECL tmat3x4<T, P> operator* ( 188 tmat2x4<T, P> const & m1, 189 tmat3x2<T, P> const & m2); 190 191 template <typename T, precision P> 192 GLM_FUNC_DECL tmat2x4<T, P> operator/ ( 193 tmat2x4<T, P> const & m, 194 T const & s); 195 196 template <typename T, precision P> 197 GLM_FUNC_DECL tmat2x4<T, P> operator/ ( 198 T const & s, 199 tmat2x4<T, P> const & m); 200 201 // Unary constant operators 202 template <typename T, precision P> 203 GLM_FUNC_DECL tmat2x4<T, P> const operator- ( 204 tmat2x4<T, P> const & m); 205 206}//namespace detail 207}//namespace glm 208 209#ifndef GLM_EXTERNAL_TEMPLATE 210#include "type_mat2x4.inl" 211#endif 212 213#endif //glm_core_type_mat2x4 214