Changeset 1138
 Timestamp:
 Feb 4, 2012, 11:18:26 PM (11 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

trunk/src/lol/math/matrix.h
r1137 r1138 51 51 52 52 /* 53 * Magic swizzling (part 1/2)53 * Magic vector swizzling (part 1/2) 54 54 */ 55 55 56 template<typename T, int I, int J> struct MagicVec256 template<typename T, int N> struct XVec2 57 57 { 58 58 inline Vec2<T> operator =(Vec2<T> that); 59 59 60 float ptr[1 + (I > J ? I : J)]; 60 static int const I = (N >> 2) & 3; 61 static int const J = (N >> 0) & 3; 62 T ptr[1 + (I > J ? I : J)]; 61 63 }; 62 64 63 template<typename T, int I, int J, int K> struct MagicVec365 template<typename T, int N> struct XVec3 64 66 { 65 67 inline Vec3<T> operator =(Vec3<T> that); 66 68 67 float ptr[1 + (I > J ? I > K ? I : K 68 : J > K ? J : K)]; 69 static int const I = (N >> 4) & 3; 70 static int const J = (N >> 2) & 3; 71 static int const K = (N >> 0) & 3; 72 T ptr[1 + (I > J ? I > K ? I : K 73 : J > K ? J : K)]; 69 74 }; 70 75 71 template<typename T, int I, int J, int K, int L> struct MagicVec476 template<typename T, int N> struct XVec4 72 77 { 73 78 inline Vec4<T> operator =(Vec4<T> that); 74 79 75 float ptr[1 + (I > J ? I > K ? I > L ? I : L : K > L ? K : L 76 : J > K ? J > L ? J : L : K > L ? K : L)]; 80 static int const I = (N >> 6) & 3; 81 static int const J = (N >> 4) & 3; 82 static int const K = (N >> 2) & 3; 83 static int const L = (N >> 0) & 3; 84 T ptr[1 + (I > J ? I > K ? I > L ? I : L : K > L ? K : L 85 : J > K ? J > L ? J : L : K > L ? K : L)]; 77 86 }; 78 87 … … 86 95 \ 87 96 void printf() const; 88 89 #define COMPLEX_OPS() \90 inline type_t operator *(type_t const &val) const \91 { \92 return type_t(x * val.x  y * val.y, x * val.y + y * val.x); \93 } \94 \95 inline type_t operator *=(type_t const &val) \96 { \97 return *this = (*this) * val; \98 } \99 \100 inline type_t operator ~() const \101 { \102 return type_t(x, y); \103 } \104 \105 inline T norm() const { return len(*this); }106 107 #define QUATERNION_OPS() \108 inline type_t operator *(type_t const &val) const \109 { \110 type_t ret; \111 Vec3<T> v1(x, y, z); \112 Vec3<T> v2(val.x, val.y, val.z); \113 Vec3<T> v3 = cross(v1, v2) + w * v2 + val.w * v1; \114 ret.x = v3.x; \115 ret.y = v3.y; \116 ret.z = v3.z; \117 ret.w = w * val.w  dot(v1, v2); \118 return ret; \119 } \120 \121 inline type_t operator *=(type_t const &val) \122 { \123 return *this = (*this) * val; \124 } \125 \126 inline type_t operator ~() const \127 { \128 type_t ret; \129 for (int n = 0; n < 3; n++) \130 ret[n] = (*this)[n]; \131 ret[3] = (*this)[3]; \132 return ret; \133 }134 97 135 98 #define OTHER_MEMBER_OPS(tname) \ … … 149 112 template <typename T> struct Vec2 150 113 { 151 typedef Vec2<T> type_t; 152 153 inline Vec2() { } 154 explicit inline Vec2(T val) { x = y = val; } 155 inline Vec2(T _x, T _y) { x = _x; y = _y; } 156 157 template<int I, int J> 158 inline Vec2(MagicVec2<T, I, J> const &v) 159 : x(v.ptr[I]), y(v.ptr[J]) {} 160 161 template<typename U, int I, int J> 162 explicit inline Vec2(MagicVec2<U, I, J> const &v) 163 : x(v.ptr[I]), y(v.ptr[J]) {} 114 inline Vec2() {} 115 inline Vec2(T X, T Y) : x(X), y(Y) {} 116 117 explicit inline Vec2(T X) : x(X), y(X) {} 118 119 template<int N> 120 inline Vec2(XVec2<T, N> const &v) 121 : x(v.ptr[v.I]), y(v.ptr[v.J]) {} 122 123 template<typename U, int N> 124 explicit inline Vec2(XVec2<U, N> const &v) 125 : x(v.ptr[v.I]), y(v.ptr[v.J]) {} 164 126 165 127 MEMBER_OPS() … … 177 139 struct { T s, t; }; 178 140 179 MagicVec2<T,0,0> xx, rr, ss;180 MagicVec2<T,0,1> xy, rg, st;181 MagicVec2<T,1,0> yx, gr, ts;182 MagicVec2<T,1,1> yy, gg, tt;183 MagicVec3<T,0,0,0> xxx, rrr, sss;184 MagicVec3<T,0,0,1> xxy, rrg, sst;185 MagicVec3<T,0,1,0> xyx, rgr, sts;186 MagicVec3<T,0,1,1> xyy, rgg, stt;187 MagicVec3<T,1,0,0> yxx, grr, tss;188 MagicVec3<T,1,0,1> yxy, grg, tst;189 MagicVec3<T,1,1,0> yyx, ggr, tts;190 MagicVec3<T,1,1,1> yyy, ggg, ttt;191 MagicVec4<T,0,0,0,0> xxxx, rrrr, ssss;192 MagicVec4<T,0,0,0,1> xxxy, rrrg, ssst;193 MagicVec4<T,0,0,1,0> xxyx, rrgr, ssts;194 MagicVec4<T,0,0,1,1> xxyy, rrgg, sstt;195 MagicVec4<T,0,1,0,0> xyxx, rgrr, stss;196 MagicVec4<T,0,1,0,1> xyxy, rgrg, stst;197 MagicVec4<T,0,1,1,0> xyyx, rggr, stts;198 MagicVec4<T,0,1,1,1> xyyy, rggg, sttt;199 MagicVec4<T,1,0,0,0> yxxx, grrr, tsss;200 MagicVec4<T,1,0,0,1> yxxy, grrg, tsst;201 MagicVec4<T,1,0,1,0> yxyx, grgr, tsts;202 MagicVec4<T,1,0,1,1> yxyy, grgg, tstt;203 MagicVec4<T,1,1,0,0> yyxx, ggrr, ttss;204 MagicVec4<T,1,1,0,1> yyxy, ggrg, ttst;205 MagicVec4<T,1,1,1,0> yyyx, gggr, ttts;206 MagicVec4<T,1,1,1,1> yyyy, gggg, tttt;141 XVec2<T,0> xx, rr, ss; 142 XVec2<T,1> xy, rg, st; 143 XVec2<T,4> yx, gr, ts; 144 XVec2<T,5> yy, gg, tt; 145 XVec3<T,0> xxx, rrr, sss; 146 XVec3<T,1> xxy, rrg, sst; 147 XVec3<T,4> xyx, rgr, sts; 148 XVec3<T,5> xyy, rgg, stt; 149 XVec3<T,16> yxx, grr, tss; 150 XVec3<T,17> yxy, grg, tst; 151 XVec3<T,20> yyx, ggr, tts; 152 XVec3<T,21> yyy, ggg, ttt; 153 XVec4<T,0> xxxx, rrrr, ssss; 154 XVec4<T,1> xxxy, rrrg, ssst; 155 XVec4<T,4> xxyx, rrgr, ssts; 156 XVec4<T,5> xxyy, rrgg, sstt; 157 XVec4<T,16> xyxx, rgrr, stss; 158 XVec4<T,17> xyxy, rgrg, stst; 159 XVec4<T,20> xyyx, rggr, stts; 160 XVec4<T,21> xyyy, rggg, sttt; 161 XVec4<T,64> yxxx, grrr, tsss; 162 XVec4<T,65> yxxy, grrg, tsst; 163 XVec4<T,68> yxyx, grgr, tsts; 164 XVec4<T,69> yxyy, grgg, tstt; 165 XVec4<T,80> yyxx, ggrr, ttss; 166 XVec4<T,81> yyxy, ggrg, ttst; 167 XVec4<T,84> yyyx, gggr, ttts; 168 XVec4<T,85> yyyy, gggg, tttt; 207 169 }; 208 170 }; … … 214 176 template <typename T> struct Cmplx 215 177 { 216 typedef Cmplx<T> type_t; 217 218 inline Cmplx() { } 219 inline Cmplx(T val) : x(val), y(0) { } 220 inline Cmplx(T _x, T _y) : x(_x), y(_y) { } 178 inline Cmplx() {} 179 inline Cmplx(T X) : x(X), y(0) {} 180 inline Cmplx(T X, T Y) : x(X), y(Y) {} 221 181 222 182 MEMBER_OPS() 223 183 224 COMPLEX_OPS() 225 184 inline Cmplx<T> operator *(Cmplx<T> const &val) const 185 { 186 return Cmplx<T>(x * val.x  y * val.y, x * val.y + y * val.x); 187 } 188 189 inline Cmplx<T> operator *=(Cmplx<T> const &val) 190 { 191 return *this = (*this) * val; 192 } 193 194 inline Cmplx<T> operator ~() const 195 { 196 return Cmplx<T>(x, y); 197 } 198 199 inline T norm() const { return len(*this); } 226 200 #if !defined __ANDROID__ 227 201 template<typename U> … … 274 248 template <typename T> struct Vec3 275 249 { 276 typedef Vec3<T> type_t; 277 278 inline Vec3() { } 279 explicit inline Vec3(T val) { x = y = z = val; } 280 inline Vec3(T _x, T _y, T _z) { x = _x; y = _y; z = _z; } 281 inline Vec3(Vec2<T> _xy, T _z) { x = _xy.x; y = _xy.y; z = _z; } 282 inline Vec3(T _x, Vec2<T> _yz) { x = _x; y = _yz.x; z = _yz.y; } 283 284 template<int I, int J, int K> 285 inline Vec3(MagicVec3<T, I, J, K> const &v) 286 : x(v.ptr[I]), y(v.ptr[J]), z(v.ptr[K]) {} 287 288 template<typename U, int I, int J, int K> 289 explicit inline Vec3(MagicVec3<U, I, J, K> const &v) 290 : x(v.ptr[I]), y(v.ptr[J]), z(v.ptr[K]) {} 250 inline Vec3() {} 251 inline Vec3(T X, T Y, T Z) : x(X), y(Y), z(Z) {} 252 inline Vec3(Vec2<T> XY, T Z) : x(XY.x), y(XY.y), z(Z) {} 253 inline Vec3(T X, Vec2<T> YZ) : x(X), y(YZ.x), z(YZ.y) {} 254 255 explicit inline Vec3(T X) : x(X), y(X), z(X) {} 256 257 template<int N> 258 inline Vec3(XVec3<T, N> const &v) 259 : x(v.ptr[v.I]), y(v.ptr[v.J]), z(v.ptr[v.K]) {} 260 261 template<typename U, int N> 262 explicit inline Vec3(XVec3<U, N> const &v) 263 : x(v.ptr[v.I]), y(v.ptr[v.J]), z(v.ptr[v.K]) {} 291 264 292 265 MEMBER_OPS() … … 307 280 struct { T s, t, p; }; 308 281 309 MagicVec2<T,0,0> xx, rr, ss;310 MagicVec2<T,0,1> xy, rg, st;311 MagicVec2<T,0,2> xz, rb, sp;312 MagicVec2<T,1,0> yx, gr, ts;313 MagicVec2<T,1,1> yy, gg, tt;314 MagicVec2<T,1,2> yz, gb, tp;315 MagicVec2<T,2,0> zx, br, ps;316 MagicVec2<T,2,1> zy, bg, pt;317 MagicVec2<T,2,2> zz, bb, pp;318 MagicVec3<T,0,0,0> xxx, rrr, sss;319 MagicVec3<T,0,0,1> xxy, rrg, sst;320 MagicVec3<T,0,0,2> xxz, rrb, ssp;321 MagicVec3<T,0,1,0> xyx, rgr, sts;322 MagicVec3<T,0,1,1> xyy, rgg, stt;323 MagicVec3<T,0,1,2> xyz, rgb, stp;324 MagicVec3<T,0,2,0> xzx, rbr, sps;325 MagicVec3<T,0,2,1> xzy, rbg, spt;326 MagicVec3<T,0,2,2> xzz, rbb, spp;327 MagicVec3<T,1,0,0> yxx, grr, tss;328 MagicVec3<T,1,0,1> yxy, grg, tst;329 MagicVec3<T,1,0,2> yxz, grb, tsp;330 MagicVec3<T,1,1,0> yyx, ggr, tts;331 MagicVec3<T,1,1,1> yyy, ggg, ttt;332 MagicVec3<T,1,1,2> yyz, ggb, ttp;333 MagicVec3<T,1,2,0> yzx, gbr, tps;334 MagicVec3<T,1,2,1> yzy, gbg, tpt;335 MagicVec3<T,1,2,2> yzz, gbb, tpp;336 MagicVec3<T,2,0,0> zxx, brr, pss;337 MagicVec3<T,2,0,1> zxy, brg, pst;338 MagicVec3<T,2,0,2> zxz, brb, psp;339 MagicVec3<T,2,1,0> zyx, bgr, pts;340 MagicVec3<T,2,1,1> zyy, bgg, ptt;341 MagicVec3<T,2,1,2> zyz, bgb, ptp;342 MagicVec3<T,2,2,0> zzx, bbr, pps;343 MagicVec3<T,2,2,1> zzy, bbg, ppt;344 MagicVec3<T,2,2,2> zzz, bbb, ppp;345 MagicVec4<T,0,0,0,0> xxxx, rrrr, ssss;346 MagicVec4<T,0,0,0,1> xxxy, rrrg, ssst;347 MagicVec4<T,0,0,0,2> xxxz, rrrb, sssp;348 MagicVec4<T,0,0,1,0> xxyx, rrgr, ssts;349 MagicVec4<T,0,0,1,1> xxyy, rrgg, sstt;350 MagicVec4<T,0,0,1,2> xxyz, rrgb, sstp;351 MagicVec4<T,0,0,2,0> xxzx, rrbr, ssps;352 MagicVec4<T,0,0,2,1> xxzy, rrbg, sspt;353 MagicVec4<T,0,0,2,2> xxzz, rrbb, sspp;354 MagicVec4<T,0,1,0,0> xyxx, rgrr, stss;355 MagicVec4<T,0,1,0,1> xyxy, rgrg, stst;356 MagicVec4<T,0,1,0,2> xyxz, rgrb, stsp;357 MagicVec4<T,0,1,1,0> xyyx, rggr, stts;358 MagicVec4<T,0,1,1,1> xyyy, rggg, sttt;359 MagicVec4<T,0,1,1,2> xyyz, rggb, sttp;360 MagicVec4<T,0,1,2,0> xyzx, rgbr, stps;361 MagicVec4<T,0,1,2,1> xyzy, rgbg, stpt;362 MagicVec4<T,0,1,2,2> xyzz, rgbb, stpp;363 MagicVec4<T,0,2,0,0> xzxx, rbrr, spss;364 MagicVec4<T,0,2,0,1> xzxy, rbrg, spst;365 MagicVec4<T,0,2,0,2> xzxz, rbrb, spsp;366 MagicVec4<T,0,2,1,0> xzyx, rbgr, spts;367 MagicVec4<T,0,2,1,1> xzyy, rbgg, sptt;368 MagicVec4<T,0,2,1,2> xzyz, rbgb, sptp;369 MagicVec4<T,0,2,2,0> xzzx, rbbr, spps;370 MagicVec4<T,0,2,2,1> xzzy, rbbg, sppt;371 MagicVec4<T,0,2,2,2> xzzz, rbbb, sppp;372 MagicVec4<T,1,0,0,0> yxxx, grrr, tsss;373 MagicVec4<T,1,0,0,1> yxxy, grrg, tsst;374 MagicVec4<T,1,0,0,2> yxxz, grrb, tssp;375 MagicVec4<T,1,0,1,0> yxyx, grgr, tsts;376 MagicVec4<T,1,0,1,1> yxyy, grgg, tstt;377 MagicVec4<T,1,0,1,2> yxyz, grgb, tstp;378 MagicVec4<T,1,0,2,0> yxzx, grbr, tsps;379 MagicVec4<T,1,0,2,1> yxzy, grbg, tspt;380 MagicVec4<T,1,0,2,2> yxzz, grbb, tspp;381 MagicVec4<T,1,1,0,0> yyxx, ggrr, ttss;382 MagicVec4<T,1,1,0,1> yyxy, ggrg, ttst;383 MagicVec4<T,1,1,0,2> yyxz, ggrb, ttsp;384 MagicVec4<T,1,1,1,0> yyyx, gggr, ttts;385 MagicVec4<T,1,1,1,1> yyyy, gggg, tttt;386 MagicVec4<T,1,1,1,2> yyyz, gggb, tttp;387 MagicVec4<T,1,1,2,0> yyzx, ggbr, ttps;388 MagicVec4<T,1,1,2,1> yyzy, ggbg, ttpt;389 MagicVec4<T,1,1,2,2> yyzz, ggbb, ttpp;390 MagicVec4<T,1,2,0,0> yzxx, gbrr, tpss;391 MagicVec4<T,1,2,0,1> yzxy, gbrg, tpst;392 MagicVec4<T,1,2,0,2> yzxz, gbrb, tpsp;393 MagicVec4<T,1,2,1,0> yzyx, gbgr, tpts;394 MagicVec4<T,1,2,1,1> yzyy, gbgg, tptt;395 MagicVec4<T,1,2,1,2> yzyz, gbgb, tptp;396 MagicVec4<T,1,2,2,0> yzzx, gbbr, tpps;397 MagicVec4<T,1,2,2,1> yzzy, gbbg, tppt;398 MagicVec4<T,1,2,2,2> yzzz, gbbb, tppp;399 MagicVec4<T,2,0,0,0> zxxx, brrr, psss;400 MagicVec4<T,2,0,0,1> zxxy, brrg, psst;401 MagicVec4<T,2,0,0,2> zxxz, brrb, pssp;402 MagicVec4<T,2,0,1,0> zxyx, brgr, psts;403 MagicVec4<T,2,0,1,1> zxyy, brgg, pstt;404 MagicVec4<T,2,0,1,2> zxyz, brgb, pstp;405 MagicVec4<T,2,0,2,0> zxzx, brbr, psps;406 MagicVec4<T,2,0,2,1> zxzy, brbg, pspt;407 MagicVec4<T,2,0,2,2> zxzz, brbb, pspp;408 MagicVec4<T,2,1,0,0> zyxx, bgrr, ptss;409 MagicVec4<T,2,1,0,1> zyxy, bgrg, ptst;410 MagicVec4<T,2,1,0,2> zyxz, bgrb, ptsp;411 MagicVec4<T,2,1,1,0> zyyx, bggr, ptts;412 MagicVec4<T,2,1,1,1> zyyy, bggg, pttt;413 MagicVec4<T,2,1,1,2> zyyz, bggb, pttp;414 MagicVec4<T,2,1,2,0> zyzx, bgbr, ptps;415 MagicVec4<T,2,1,2,1> zyzy, bgbg, ptpt;416 MagicVec4<T,2,1,2,2> zyzz, bgbb, ptpp;417 MagicVec4<T,2,2,0,0> zzxx, bbrr, ppss;418 MagicVec4<T,2,2,0,1> zzxy, bbrg, ppst;419 MagicVec4<T,2,2,0,2> zzxz, bbrb, ppsp;420 MagicVec4<T,2,2,1,0> zzyx, bbgr, ppts;421 MagicVec4<T,2,2,1,1> zzyy, bbgg, pptt;422 MagicVec4<T,2,2,1,2> zzyz, bbgb, pptp;423 MagicVec4<T,2,2,2,0> zzzx, bbbr, ppps;424 MagicVec4<T,2,2,2,1> zzzy, bbbg, pppt;425 MagicVec4<T,2,2,2,2> zzzz, bbbb, pppp;282 XVec2<T,0> xx, rr, ss; 283 XVec2<T,1> xy, rg, st; 284 XVec2<T,2> xz, rb, sp; 285 XVec2<T,4> yx, gr, ts; 286 XVec2<T,5> yy, gg, tt; 287 XVec2<T,6> yz, gb, tp; 288 XVec2<T,8> zx, br, ps; 289 XVec2<T,9> zy, bg, pt; 290 XVec2<T,10> zz, bb, pp; 291 XVec3<T,0> xxx, rrr, sss; 292 XVec3<T,1> xxy, rrg, sst; 293 XVec3<T,2> xxz, rrb, ssp; 294 XVec3<T,4> xyx, rgr, sts; 295 XVec3<T,5> xyy, rgg, stt; 296 XVec3<T,6> xyz, rgb, stp; 297 XVec3<T,8> xzx, rbr, sps; 298 XVec3<T,9> xzy, rbg, spt; 299 XVec3<T,10> xzz, rbb, spp; 300 XVec3<T,16> yxx, grr, tss; 301 XVec3<T,17> yxy, grg, tst; 302 XVec3<T,18> yxz, grb, tsp; 303 XVec3<T,20> yyx, ggr, tts; 304 XVec3<T,21> yyy, ggg, ttt; 305 XVec3<T,22> yyz, ggb, ttp; 306 XVec3<T,24> yzx, gbr, tps; 307 XVec3<T,25> yzy, gbg, tpt; 308 XVec3<T,26> yzz, gbb, tpp; 309 XVec3<T,32> zxx, brr, pss; 310 XVec3<T,33> zxy, brg, pst; 311 XVec3<T,34> zxz, brb, psp; 312 XVec3<T,36> zyx, bgr, pts; 313 XVec3<T,37> zyy, bgg, ptt; 314 XVec3<T,38> zyz, bgb, ptp; 315 XVec3<T,40> zzx, bbr, pps; 316 XVec3<T,41> zzy, bbg, ppt; 317 XVec3<T,42> zzz, bbb, ppp; 318 XVec4<T,0> xxxx, rrrr, ssss; 319 XVec4<T,1> xxxy, rrrg, ssst; 320 XVec4<T,2> xxxz, rrrb, sssp; 321 XVec4<T,4> xxyx, rrgr, ssts; 322 XVec4<T,5> xxyy, rrgg, sstt; 323 XVec4<T,6> xxyz, rrgb, sstp; 324 XVec4<T,8> xxzx, rrbr, ssps; 325 XVec4<T,9> xxzy, rrbg, sspt; 326 XVec4<T,10> xxzz, rrbb, sspp; 327 XVec4<T,16> xyxx, rgrr, stss; 328 XVec4<T,17> xyxy, rgrg, stst; 329 XVec4<T,18> xyxz, rgrb, stsp; 330 XVec4<T,20> xyyx, rggr, stts; 331 XVec4<T,21> xyyy, rggg, sttt; 332 XVec4<T,22> xyyz, rggb, sttp; 333 XVec4<T,24> xyzx, rgbr, stps; 334 XVec4<T,25> xyzy, rgbg, stpt; 335 XVec4<T,26> xyzz, rgbb, stpp; 336 XVec4<T,32> xzxx, rbrr, spss; 337 XVec4<T,33> xzxy, rbrg, spst; 338 XVec4<T,34> xzxz, rbrb, spsp; 339 XVec4<T,36> xzyx, rbgr, spts; 340 XVec4<T,37> xzyy, rbgg, sptt; 341 XVec4<T,38> xzyz, rbgb, sptp; 342 XVec4<T,40> xzzx, rbbr, spps; 343 XVec4<T,41> xzzy, rbbg, sppt; 344 XVec4<T,42> xzzz, rbbb, sppp; 345 XVec4<T,64> yxxx, grrr, tsss; 346 XVec4<T,65> yxxy, grrg, tsst; 347 XVec4<T,66> yxxz, grrb, tssp; 348 XVec4<T,68> yxyx, grgr, tsts; 349 XVec4<T,69> yxyy, grgg, tstt; 350 XVec4<T,70> yxyz, grgb, tstp; 351 XVec4<T,72> yxzx, grbr, tsps; 352 XVec4<T,73> yxzy, grbg, tspt; 353 XVec4<T,74> yxzz, grbb, tspp; 354 XVec4<T,80> yyxx, ggrr, ttss; 355 XVec4<T,81> yyxy, ggrg, ttst; 356 XVec4<T,82> yyxz, ggrb, ttsp; 357 XVec4<T,84> yyyx, gggr, ttts; 358 XVec4<T,85> yyyy, gggg, tttt; 359 XVec4<T,86> yyyz, gggb, tttp; 360 XVec4<T,88> yyzx, ggbr, ttps; 361 XVec4<T,89> yyzy, ggbg, ttpt; 362 XVec4<T,90> yyzz, ggbb, ttpp; 363 XVec4<T,96> yzxx, gbrr, tpss; 364 XVec4<T,97> yzxy, gbrg, tpst; 365 XVec4<T,98> yzxz, gbrb, tpsp; 366 XVec4<T,100> yzyx, gbgr, tpts; 367 XVec4<T,101> yzyy, gbgg, tptt; 368 XVec4<T,102> yzyz, gbgb, tptp; 369 XVec4<T,104> yzzx, gbbr, tpps; 370 XVec4<T,105> yzzy, gbbg, tppt; 371 XVec4<T,106> yzzz, gbbb, tppp; 372 XVec4<T,128> zxxx, brrr, psss; 373 XVec4<T,129> zxxy, brrg, psst; 374 XVec4<T,130> zxxz, brrb, pssp; 375 XVec4<T,132> zxyx, brgr, psts; 376 XVec4<T,133> zxyy, brgg, pstt; 377 XVec4<T,134> zxyz, brgb, pstp; 378 XVec4<T,136> zxzx, brbr, psps; 379 XVec4<T,137> zxzy, brbg, pspt; 380 XVec4<T,138> zxzz, brbb, pspp; 381 XVec4<T,144> zyxx, bgrr, ptss; 382 XVec4<T,145> zyxy, bgrg, ptst; 383 XVec4<T,146> zyxz, bgrb, ptsp; 384 XVec4<T,148> zyyx, bggr, ptts; 385 XVec4<T,149> zyyy, bggg, pttt; 386 XVec4<T,150> zyyz, bggb, pttp; 387 XVec4<T,152> zyzx, bgbr, ptps; 388 XVec4<T,153> zyzy, bgbg, ptpt; 389 XVec4<T,154> zyzz, bgbb, ptpp; 390 XVec4<T,160> zzxx, bbrr, ppss; 391 XVec4<T,161> zzxy, bbrg, ppst; 392 XVec4<T,162> zzxz, bbrb, ppsp; 393 XVec4<T,164> zzyx, bbgr, ppts; 394 XVec4<T,165> zzyy, bbgg, pptt; 395 XVec4<T,166> zzyz, bbgb, pptp; 396 XVec4<T,168> zzzx, bbbr, ppps; 397 XVec4<T,169> zzzy, bbbg, pppt; 398 XVec4<T,170> zzzz, bbbb, pppp; 426 399 }; 427 400 }; … … 433 406 template <typename T> struct Vec4 434 407 { 435 typedef Vec4<T> type_t; 436 437 inline Vec4() { } 438 explicit inline Vec4(T val) : x(val), y(val), z(val), w(val) { } 439 inline Vec4(T _x, T _y, T _z, T _w) : x(_x), y(_y), z(_z), w(_w) { } 440 inline Vec4(Vec2<T> _xy, T _z, T _w) : x(_xy.x), y(_xy.y), z(_z), w(_w) { } 441 inline Vec4(T _x, Vec2<T> _yz, T _w) : x(_x), y(_yz.x), z(_yz.y), w(_w) { } 442 inline Vec4(T _x, T _y, Vec2<T> _zw) : x(_x), y(_y), z(_zw.x), w(_zw.y) { } 443 inline Vec4(Vec2<T> _xy, Vec2<T> _zw) : x(_xy.x), y(_xy.y), z(_zw.x), w(_zw.y) { } 444 inline Vec4(Vec3<T> _xyz, T _w) : x(_xyz.x), y(_xyz.y), z(_xyz.z), w(_w) { } 445 inline Vec4(T _x, Vec3<T> _yzw) : x(_x), y(_yzw.x), z(_yzw.y), w(_yzw.z) { } 446 447 template<int I, int J, int K, int L> 448 inline Vec4(MagicVec4<T, I, J, K, L> const &v) 449 : x(v.ptr[I]), y(v.ptr[J]), z(v.ptr[K]), w(v.ptr[L]) {} 450 451 template<typename U, int I, int J, int K, int L> 452 explicit inline Vec4(MagicVec4<U, I, J, K, L> const &v) 453 : x(v.ptr[I]), y(v.ptr[J]), z(v.ptr[K]), w(v.ptr[L]) {} 408 inline Vec4() {} 409 inline Vec4(T X, T Y, T Z, T W) : x(X), y(Y), z(Z), w(W) {} 410 inline Vec4(Vec2<T> XY, T Z, T W) : x(XY.x), y(XY.y), z(Z), w(W) {} 411 inline Vec4(T X, Vec2<T> YZ, T W) : x(X), y(YZ.x), z(YZ.y), w(W) {} 412 inline Vec4(T X, T Y, Vec2<T> ZW) : x(X), y(Y), z(ZW.x), w(ZW.y) {} 413 inline Vec4(Vec2<T> XY, Vec2<T> ZW) : x(XY.x), y(XY.y), z(ZW.x), w(ZW.y) {} 414 inline Vec4(Vec3<T> XYZ, T W) : x(XYZ.x), y(XYZ.y), z(XYZ.z), w(W) {} 415 inline Vec4(T X, Vec3<T> YZW) : x(X), y(YZW.x), z(YZW.y), w(YZW.z) {} 416 417 explicit inline Vec4(T X) : x(X), y(X), z(X), w(X) {} 418 419 template<int N> 420 inline Vec4(XVec4<T, N> const &v) 421 : x(v.ptr[v.I]), y(v.ptr[v.J]), z(v.ptr[v.K]), w(v.ptr[v.L]) {} 422 423 template<typename U, int N> 424 explicit inline Vec4(XVec4<U, N> const &v) 425 : x(v.ptr[v.I]), y(v.ptr[v.J]), z(v.ptr[v.K]), w(v.ptr[v.L]) {} 454 426 455 427 MEMBER_OPS() … … 467 439 struct { T s, t, p, q; }; 468 440 469 MagicVec2<T,0,0> xx, rr, ss;470 MagicVec2<T,0,1> xy, rg, st;471 MagicVec2<T,0,2> xz, rb, sp;472 MagicVec2<T,0,3> xw, ra, sq;473 MagicVec2<T,1,0> yx, gr, ts;474 MagicVec2<T,1,1> yy, gg, tt;475 MagicVec2<T,1,2> yz, gb, tp;476 MagicVec2<T,1,3> yw, ga, tq;477 MagicVec2<T,2,0> zx, br, ps;478 MagicVec2<T,2,1> zy, bg, pt;479 MagicVec2<T,2,2> zz, bb, pp;480 MagicVec2<T,2,3> zw, ba, pq;481 MagicVec2<T,3,0> wx, ar, qs;482 MagicVec2<T,3,1> wy, ag, qt;483 MagicVec2<T,3,2> wz, ab, qp;484 MagicVec2<T,3,3> ww, aa, qq;485 MagicVec3<T,0,0,0> xxx, rrr, sss;486 MagicVec3<T,0,0,1> xxy, rrg, sst;487 MagicVec3<T,0,0,2> xxz, rrb, ssp;488 MagicVec3<T,0,0,3> xxw, rra, ssq;489 MagicVec3<T,0,1,0> xyx, rgr, sts;490 MagicVec3<T,0,1,1> xyy, rgg, stt;491 MagicVec3<T,0,1,2> xyz, rgb, stp;492 MagicVec3<T,0,1,3> xyw, rga, stq;493 MagicVec3<T,0,2,0> xzx, rbr, sps;494 MagicVec3<T,0,2,1> xzy, rbg, spt;495 MagicVec3<T,0,2,2> xzz, rbb, spp;496 MagicVec3<T,0,2,3> xzw, rba, spq;497 MagicVec3<T,0,3,0> xwx, rar, sqs;498 MagicVec3<T,0,3,1> xwy, rag, sqt;499 MagicVec3<T,0,3,2> xwz, rab, sqp;500 MagicVec3<T,0,3,3> xww, raa, sqq;501 MagicVec3<T,1,0,0> yxx, grr, tss;502 MagicVec3<T,1,0,1> yxy, grg, tst;503 MagicVec3<T,1,0,2> yxz, grb, tsp;504 MagicVec3<T,1,0,3> yxw, gra, tsq;505 MagicVec3<T,1,1,0> yyx, ggr, tts;506 MagicVec3<T,1,1,1> yyy, ggg, ttt;507 MagicVec3<T,1,1,2> yyz, ggb, ttp;508 MagicVec3<T,1,1,3> yyw, gga, ttq;509 MagicVec3<T,1,2,0> yzx, gbr, tps;510 MagicVec3<T,1,2,1> yzy, gbg, tpt;511 MagicVec3<T,1,2,2> yzz, gbb, tpp;512 MagicVec3<T,1,2,3> yzw, gba, tpq;513 MagicVec3<T,1,3,0> ywx, gar, tqs;514 MagicVec3<T,1,3,1> ywy, gag, tqt;515 MagicVec3<T,1,3,2> ywz, gab, tqp;516 MagicVec3<T,1,3,3> yww, gaa, tqq;517 MagicVec3<T,2,0,0> zxx, brr, pss;518 MagicVec3<T,2,0,1> zxy, brg, pst;519 MagicVec3<T,2,0,2> zxz, brb, psp;520 MagicVec3<T,2,0,3> zxw, bra, psq;521 MagicVec3<T,2,1,0> zyx, bgr, pts;522 MagicVec3<T,2,1,1> zyy, bgg, ptt;523 MagicVec3<T,2,1,2> zyz, bgb, ptp;524 MagicVec3<T,2,1,3> zyw, bga, ptq;525 MagicVec3<T,2,2,0> zzx, bbr, pps;526 MagicVec3<T,2,2,1> zzy, bbg, ppt;527 MagicVec3<T,2,2,2> zzz, bbb, ppp;528 MagicVec3<T,2,2,3> zzw, bba, ppq;529 MagicVec3<T,2,3,0> zwx, bar, pqs;530 MagicVec3<T,2,3,1> zwy, bag, pqt;531 MagicVec3<T,2,3,2> zwz, bab, pqp;532 MagicVec3<T,2,3,3> zww, baa, pqq;533 MagicVec3<T,3,0,0> wxx, arr, qss;534 MagicVec3<T,3,0,1> wxy, arg, qst;535 MagicVec3<T,3,0,2> wxz, arb, qsp;536 MagicVec3<T,3,0,3> wxw, ara, qsq;537 MagicVec3<T,3,1,0> wyx, agr, qts;538 MagicVec3<T,3,1,1> wyy, agg, qtt;539 MagicVec3<T,3,1,2> wyz, agb, qtp;540 MagicVec3<T,3,1,3> wyw, aga, qtq;541 MagicVec3<T,3,2,0> wzx, abr, qps;542 MagicVec3<T,3,2,1> wzy, abg, qpt;543 MagicVec3<T,3,2,2> wzz, abb, qpp;544 MagicVec3<T,3,2,3> wzw, aba, qpq;545 MagicVec3<T,3,3,0> wwx, aar, qqs;546 MagicVec3<T,3,3,1> wwy, aag, qqt;547 MagicVec3<T,3,3,2> wwz, aab, qqp;548 MagicVec3<T,3,3,3> www, aaa, qqq;549 MagicVec4<T,0,0,0,0> xxxx, rrrr, ssss;550 MagicVec4<T,0,0,0,1> xxxy, rrrg, ssst;551 MagicVec4<T,0,0,0,2> xxxz, rrrb, sssp;552 MagicVec4<T,0,0,0,3> xxxw, rrra, sssq;553 MagicVec4<T,0,0,1,0> xxyx, rrgr, ssts;554 MagicVec4<T,0,0,1,1> xxyy, rrgg, sstt;555 MagicVec4<T,0,0,1,2> xxyz, rrgb, sstp;556 MagicVec4<T,0,0,1,3> xxyw, rrga, sstq;557 MagicVec4<T,0,0,2,0> xxzx, rrbr, ssps;558 MagicVec4<T,0,0,2,1> xxzy, rrbg, sspt;559 MagicVec4<T,0,0,2,2> xxzz, rrbb, sspp;560 MagicVec4<T,0,0,2,3> xxzw, rrba, sspq;561 MagicVec4<T,0,0,3,0> xxwx, rrar, ssqs;562 MagicVec4<T,0,0,3,1> xxwy, rrag, ssqt;563 MagicVec4<T,0,0,3,2> xxwz, rrab, ssqp;564 MagicVec4<T,0,0,3,3> xxww, rraa, ssqq;565 MagicVec4<T,0,1,0,0> xyxx, rgrr, stss;566 MagicVec4<T,0,1,0,1> xyxy, rgrg, stst;567 MagicVec4<T,0,1,0,2> xyxz, rgrb, stsp;568 MagicVec4<T,0,1,0,3> xyxw, rgra, stsq;569 MagicVec4<T,0,1,1,0> xyyx, rggr, stts;570 MagicVec4<T,0,1,1,1> xyyy, rggg, sttt;571 MagicVec4<T,0,1,1,2> xyyz, rggb, sttp;572 MagicVec4<T,0,1,1,3> xyyw, rgga, sttq;573 MagicVec4<T,0,1,2,0> xyzx, rgbr, stps;574 MagicVec4<T,0,1,2,1> xyzy, rgbg, stpt;575 MagicVec4<T,0,1,2,2> xyzz, rgbb, stpp;576 MagicVec4<T,0,1,2,3> xyzw, rgba, stpq;577 MagicVec4<T,0,1,3,0> xywx, rgar, stqs;578 MagicVec4<T,0,1,3,1> xywy, rgag, stqt;579 MagicVec4<T,0,1,3,2> xywz, rgab, stqp;580 MagicVec4<T,0,1,3,3> xyww, rgaa, stqq;581 MagicVec4<T,0,2,0,0> xzxx, rbrr, spss;582 MagicVec4<T,0,2,0,1> xzxy, rbrg, spst;583 MagicVec4<T,0,2,0,2> xzxz, rbrb, spsp;584 MagicVec4<T,0,2,0,3> xzxw, rbra, spsq;585 MagicVec4<T,0,2,1,0> xzyx, rbgr, spts;586 MagicVec4<T,0,2,1,1> xzyy, rbgg, sptt;587 MagicVec4<T,0,2,1,2> xzyz, rbgb, sptp;588 MagicVec4<T,0,2,1,3> xzyw, rbga, sptq;589 MagicVec4<T,0,2,2,0> xzzx, rbbr, spps;590 MagicVec4<T,0,2,2,1> xzzy, rbbg, sppt;591 MagicVec4<T,0,2,2,2> xzzz, rbbb, sppp;592 MagicVec4<T,0,2,2,3> xzzw, rbba, sppq;593 MagicVec4<T,0,2,3,0> xzwx, rbar, spqs;594 MagicVec4<T,0,2,3,1> xzwy, rbag, spqt;595 MagicVec4<T,0,2,3,2> xzwz, rbab, spqp;596 MagicVec4<T,0,2,3,3> xzww, rbaa, spqq;597 MagicVec4<T,0,3,0,0> xwxx, rarr, sqss;598 MagicVec4<T,0,3,0,1> xwxy, rarg, sqst;599 MagicVec4<T,0,3,0,2> xwxz, rarb, sqsp;600 MagicVec4<T,0,3,0,3> xwxw, rara, sqsq;601 MagicVec4<T,0,3,1,0> xwyx, ragr, sqts;602 MagicVec4<T,0,3,1,1> xwyy, ragg, sqtt;603 MagicVec4<T,0,3,1,2> xwyz, ragb, sqtp;604 MagicVec4<T,0,3,1,3> xwyw, raga, sqtq;605 MagicVec4<T,0,3,2,0> xwzx, rabr, sqps;606 MagicVec4<T,0,3,2,1> xwzy, rabg, sqpt;607 MagicVec4<T,0,3,2,2> xwzz, rabb, sqpp;608 MagicVec4<T,0,3,2,3> xwzw, raba, sqpq;609 MagicVec4<T,0,3,3,0> xwwx, raar, sqqs;610 MagicVec4<T,0,3,3,1> xwwy, raag, sqqt;611 MagicVec4<T,0,3,3,2> xwwz, raab, sqqp;612 MagicVec4<T,0,3,3,3> xwww, raaa, sqqq;613 MagicVec4<T,1,0,0,0> yxxx, grrr, tsss;614 MagicVec4<T,1,0,0,1> yxxy, grrg, tsst;615 MagicVec4<T,1,0,0,2> yxxz, grrb, tssp;616 MagicVec4<T,1,0,0,3> yxxw, grra, tssq;617 MagicVec4<T,1,0,1,0> yxyx, grgr, tsts;618 MagicVec4<T,1,0,1,1> yxyy, grgg, tstt;619 MagicVec4<T,1,0,1,2> yxyz, grgb, tstp;620 MagicVec4<T,1,0,1,3> yxyw, grga, tstq;621 MagicVec4<T,1,0,2,0> yxzx, grbr, tsps;622 MagicVec4<T,1,0,2,1> yxzy, grbg, tspt;623 MagicVec4<T,1,0,2,2> yxzz, grbb, tspp;624 MagicVec4<T,1,0,2,3> yxzw, grba, tspq;625 MagicVec4<T,1,0,3,0> yxwx, grar, tsqs;626 MagicVec4<T,1,0,3,1> yxwy, grag, tsqt;627 MagicVec4<T,1,0,3,2> yxwz, grab, tsqp;628 MagicVec4<T,1,0,3,3> yxww, graa, tsqq;629 MagicVec4<T,1,1,0,0> yyxx, ggrr, ttss;630 MagicVec4<T,1,1,0,1> yyxy, ggrg, ttst;631 MagicVec4<T,1,1,0,2> yyxz, ggrb, ttsp;632 MagicVec4<T,1,1,0,3> yyxw, ggra, ttsq;633 MagicVec4<T,1,1,1,0> yyyx, gggr, ttts;634 MagicVec4<T,1,1,1,1> yyyy, gggg, tttt;635 MagicVec4<T,1,1,1,2> yyyz, gggb, tttp;636 MagicVec4<T,1,1,1,3> yyyw, ggga, tttq;637 MagicVec4<T,1,1,2,0> yyzx, ggbr, ttps;638 MagicVec4<T,1,1,2,1> yyzy, ggbg, ttpt;639 MagicVec4<T,1,1,2,2> yyzz, ggbb, ttpp;640 MagicVec4<T,1,1,2,3> yyzw, ggba, ttpq;641 MagicVec4<T,1,1,3,0> yywx, ggar, ttqs;642 MagicVec4<T,1,1,3,1> yywy, ggag, ttqt;643 MagicVec4<T,1,1,3,2> yywz, ggab, ttqp;644 MagicVec4<T,1,1,3,3> yyww, ggaa, ttqq;645 MagicVec4<T,1,2,0,0> yzxx, gbrr, tpss;646 MagicVec4<T,1,2,0,1> yzxy, gbrg, tpst;647 MagicVec4<T,1,2,0,2> yzxz, gbrb, tpsp;648 MagicVec4<T,1,2,0,3> yzxw, gbra, tpsq;649 MagicVec4<T,1,2,1,0> yzyx, gbgr, tpts;650 MagicVec4<T,1,2,1,1> yzyy, gbgg, tptt;651 MagicVec4<T,1,2,1,2> yzyz, gbgb, tptp;652 MagicVec4<T,1,2,1,3> yzyw, gbga, tptq;653 MagicVec4<T,1,2,2,0> yzzx, gbbr, tpps;654 MagicVec4<T,1,2,2,1> yzzy, gbbg, tppt;655 MagicVec4<T,1,2,2,2> yzzz, gbbb, tppp;656 MagicVec4<T,1,2,2,3> yzzw, gbba, tppq;657 MagicVec4<T,1,2,3,0> yzwx, gbar, tpqs;658 MagicVec4<T,1,2,3,1> yzwy, gbag, tpqt;659 MagicVec4<T,1,2,3,2> yzwz, gbab, tpqp;660 MagicVec4<T,1,2,3,3> yzww, gbaa, tpqq;661 MagicVec4<T,1,3,0,0> ywxx, garr, tqss;662 MagicVec4<T,1,3,0,1> ywxy, garg, tqst;663 MagicVec4<T,1,3,0,2> ywxz, garb, tqsp;664 MagicVec4<T,1,3,0,3> ywxw, gara, tqsq;665 MagicVec4<T,1,3,1,0> ywyx, gagr, tqts;666 MagicVec4<T,1,3,1,1> ywyy, gagg, tqtt;667 MagicVec4<T,1,3,1,2> ywyz, gagb, tqtp;668 MagicVec4<T,1,3,1,3> ywyw, gaga, tqtq;669 MagicVec4<T,1,3,2,0> ywzx, gabr, tqps;670 MagicVec4<T,1,3,2,1> ywzy, gabg, tqpt;671 MagicVec4<T,1,3,2,2> ywzz, gabb, tqpp;672 MagicVec4<T,1,3,2,3> ywzw, gaba, tqpq;673 MagicVec4<T,1,3,3,0> ywwx, gaar, tqqs;674 MagicVec4<T,1,3,3,1> ywwy, gaag, tqqt;675 MagicVec4<T,1,3,3,2> ywwz, gaab, tqqp;676 MagicVec4<T,1,3,3,3> ywww, gaaa, tqqq;677 MagicVec4<T,2,0,0,0> zxxx, brrr, psss;678 MagicVec4<T,2,0,0,1> zxxy, brrg, psst;679 MagicVec4<T,2,0,0,2> zxxz, brrb, pssp;680 MagicVec4<T,2,0,0,3> zxxw, brra, pssq;681 MagicVec4<T,2,0,1,0> zxyx, brgr, psts;682 MagicVec4<T,2,0,1,1> zxyy, brgg, pstt;683 MagicVec4<T,2,0,1,2> zxyz, brgb, pstp;684 MagicVec4<T,2,0,1,3> zxyw, brga, pstq;685 MagicVec4<T,2,0,2,0> zxzx, brbr, psps;686 MagicVec4<T,2,0,2,1> zxzy, brbg, pspt;687 MagicVec4<T,2,0,2,2> zxzz, brbb, pspp;688 MagicVec4<T,2,0,2,3> zxzw, brba, pspq;689 MagicVec4<T,2,0,3,0> zxwx, brar, psqs;690 MagicVec4<T,2,0,3,1> zxwy, brag, psqt;691 MagicVec4<T,2,0,3,2> zxwz, brab, psqp;692 MagicVec4<T,2,0,3,3> zxww, braa, psqq;693 MagicVec4<T,2,1,0,0> zyxx, bgrr, ptss;694 MagicVec4<T,2,1,0,1> zyxy, bgrg, ptst;695 MagicVec4<T,2,1,0,2> zyxz, bgrb, ptsp;696 MagicVec4<T,2,1,0,3> zyxw, bgra, ptsq;697 MagicVec4<T,2,1,1,0> zyyx, bggr, ptts;698 MagicVec4<T,2,1,1,1> zyyy, bggg, pttt;699 MagicVec4<T,2,1,1,2> zyyz, bggb, pttp;700 MagicVec4<T,2,1,1,3> zyyw, bgga, pttq;701 MagicVec4<T,2,1,2,0> zyzx, bgbr, ptps;702 MagicVec4<T,2,1,2,1> zyzy, bgbg, ptpt;703 MagicVec4<T,2,1,2,2> zyzz, bgbb, ptpp;704 MagicVec4<T,2,1,2,3> zyzw, bgba, ptpq;705 MagicVec4<T,2,1,3,0> zywx, bgar, ptqs;706 MagicVec4<T,2,1,3,1> zywy, bgag, ptqt;707 MagicVec4<T,2,1,3,2> zywz, bgab, ptqp;708 MagicVec4<T,2,1,3,3> zyww, bgaa, ptqq;709 MagicVec4<T,2,2,0,0> zzxx, bbrr, ppss;710 MagicVec4<T,2,2,0,1> zzxy, bbrg, ppst;711 MagicVec4<T,2,2,0,2> zzxz, bbrb, ppsp;712 MagicVec4<T,2,2,0,3> zzxw, bbra, ppsq;713 MagicVec4<T,2,2,1,0> zzyx, bbgr, ppts;714 MagicVec4<T,2,2,1,1> zzyy, bbgg, pptt;715 MagicVec4<T,2,2,1,2> zzyz, bbgb, pptp;716 MagicVec4<T,2,2,1,3> zzyw, bbga, pptq;717 MagicVec4<T,2,2,2,0> zzzx, bbbr, ppps;718 MagicVec4<T,2,2,2,1> zzzy, bbbg, pppt;719 MagicVec4<T,2,2,2,2> zzzz, bbbb, pppp;720 MagicVec4<T,2,2,2,3> zzzw, bbba, pppq;721 MagicVec4<T,2,2,3,0> zzwx, bbar, ppqs;722 MagicVec4<T,2,2,3,1> zzwy, bbag, ppqt;723 MagicVec4<T,2,2,3,2> zzwz, bbab, ppqp;724 MagicVec4<T,2,2,3,3> zzww, bbaa, ppqq;725 MagicVec4<T,2,3,0,0> zwxx, barr, pqss;726 MagicVec4<T,2,3,0,1> zwxy, barg, pqst;727 MagicVec4<T,2,3,0,2> zwxz, barb, pqsp;728 MagicVec4<T,2,3,0,3> zwxw, bara, pqsq;729 MagicVec4<T,2,3,1,0> zwyx, bagr, pqts;730 MagicVec4<T,2,3,1,1> zwyy, bagg, pqtt;731 MagicVec4<T,2,3,1,2> zwyz, bagb, pqtp;732 MagicVec4<T,2,3,1,3> zwyw, baga, pqtq;733 MagicVec4<T,2,3,2,0> zwzx, babr, pqps;734 MagicVec4<T,2,3,2,1> zwzy, babg, pqpt;735 MagicVec4<T,2,3,2,2> zwzz, babb, pqpp;736 MagicVec4<T,2,3,2,3> zwzw, baba, pqpq;737 MagicVec4<T,2,3,3,0> zwwx, baar, pqqs;738 MagicVec4<T,2,3,3,1> zwwy, baag, pqqt;739 MagicVec4<T,2,3,3,2> zwwz, baab, pqqp;740 MagicVec4<T,2,3,3,3> zwww, baaa, pqqq;741 MagicVec4<T,3,0,0,0> wxxx, arrr, qsss;742 MagicVec4<T,3,0,0,1> wxxy, arrg, qsst;743 MagicVec4<T,3,0,0,2> wxxz, arrb, qssp;744 MagicVec4<T,3,0,0,3> wxxw, arra, qssq;745 MagicVec4<T,3,0,1,0> wxyx, argr, qsts;746 MagicVec4<T,3,0,1,1> wxyy, argg, qstt;747 MagicVec4<T,3,0,1,2> wxyz, argb, qstp;748 MagicVec4<T,3,0,1,3> wxyw, arga, qstq;749 MagicVec4<T,3,0,2,0> wxzx, arbr, qsps;750 MagicVec4<T,3,0,2,1> wxzy, arbg, qspt;751 MagicVec4<T,3,0,2,2> wxzz, arbb, qspp;752 MagicVec4<T,3,0,2,3> wxzw, arba, qspq;753 MagicVec4<T,3,0,3,0> wxwx, arar, qsqs;754 MagicVec4<T,3,0,3,1> wxwy, arag, qsqt;755 MagicVec4<T,3,0,3,2> wxwz, arab, qsqp;756 MagicVec4<T,3,0,3,3> wxww, araa, qsqq;757 MagicVec4<T,3,1,0,0> wyxx, agrr, qtss;758 MagicVec4<T,3,1,0,1> wyxy, agrg, qtst;759 MagicVec4<T,3,1,0,2> wyxz, agrb, qtsp;760 MagicVec4<T,3,1,0,3> wyxw, agra, qtsq;761 MagicVec4<T,3,1,1,0> wyyx, aggr, qtts;762 MagicVec4<T,3,1,1,1> wyyy, aggg, qttt;763 MagicVec4<T,3,1,1,2> wyyz, aggb, qttp;764 MagicVec4<T,3,1,1,3> wyyw, agga, qttq;765 MagicVec4<T,3,1,2,0> wyzx, agbr, qtps;766 MagicVec4<T,3,1,2,1> wyzy, agbg, qtpt;767 MagicVec4<T,3,1,2,2> wyzz, agbb, qtpp;768 MagicVec4<T,3,1,2,3> wyzw, agba, qtpq;769 MagicVec4<T,3,1,3,0> wywx, agar, qtqs;770 MagicVec4<T,3,1,3,1> wywy, agag, qtqt;771 MagicVec4<T,3,1,3,2> wywz, agab, qtqp;772 MagicVec4<T,3,1,3,3> wyww, agaa, qtqq;773 MagicVec4<T,3,2,0,0> wzxx, abrr, qpss;774 MagicVec4<T,3,2,0,1> wzxy, abrg, qpst;775 MagicVec4<T,3,2,0,2> wzxz, abrb, qpsp;776 MagicVec4<T,3,2,0,3> wzxw, abra, qpsq;777 MagicVec4<T,3,2,1,0> wzyx, abgr, qpts;778 MagicVec4<T,3,2,1,1> wzyy, abgg, qptt;779 MagicVec4<T,3,2,1,2> wzyz, abgb, qptp;780 MagicVec4<T,3,2,1,3> wzyw, abga, qptq;781 MagicVec4<T,3,2,2,0> wzzx, abbr, qpps;782 MagicVec4<T,3,2,2,1> wzzy, abbg, qppt;783 MagicVec4<T,3,2,2,2> wzzz, abbb, qppp;784 MagicVec4<T,3,2,2,3> wzzw, abba, qppq;785 MagicVec4<T,3,2,3,0> wzwx, abar, qpqs;786 MagicVec4<T,3,2,3,1> wzwy, abag, qpqt;787 MagicVec4<T,3,2,3,2> wzwz, abab, qpqp;788 MagicVec4<T,3,2,3,3> wzww, abaa, qpqq;789 MagicVec4<T,3,3,0,0> wwxx, aarr, qqss;790 MagicVec4<T,3,3,0,1> wwxy, aarg, qqst;791 MagicVec4<T,3,3,0,2> wwxz, aarb, qqsp;792 MagicVec4<T,3,3,0,3> wwxw, aara, qqsq;793 MagicVec4<T,3,3,1,0> wwyx, aagr, qqts;794 MagicVec4<T,3,3,1,1> wwyy, aagg, qqtt;795 MagicVec4<T,3,3,1,2> wwyz, aagb, qqtp;796 MagicVec4<T,3,3,1,3> wwyw, aaga, qqtq;797 MagicVec4<T,3,3,2,0> wwzx, aabr, qqps;798 MagicVec4<T,3,3,2,1> wwzy, aabg, qqpt;799 MagicVec4<T,3,3,2,2> wwzz, aabb, qqpp;800 MagicVec4<T,3,3,2,3> wwzw, aaba, qqpq;801 MagicVec4<T,3,3,3,0> wwwx, aaar, qqqs;802 MagicVec4<T,3,3,3,1> wwwy, aaag, qqqt;803 MagicVec4<T,3,3,3,2> wwwz, aaab, qqqp;804 MagicVec4<T,3,3,3,3> wwww, aaaa, qqqq;441 XVec2<T,0> xx, rr, ss; 442 XVec2<T,1> xy, rg, st; 443 XVec2<T,2> xz, rb, sp; 444 XVec2<T,3> xw, ra, sq; 445 XVec2<T,4> yx, gr, ts; 446 XVec2<T,5> yy, gg, tt; 447 XVec2<T,6> yz, gb, tp; 448 XVec2<T,7> yw, ga, tq; 449 XVec2<T,8> zx, br, ps; 450 XVec2<T,9> zy, bg, pt; 451 XVec2<T,10> zz, bb, pp; 452 XVec2<T,11> zw, ba, pq; 453 XVec2<T,12> wx, ar, qs; 454 XVec2<T,13> wy, ag, qt; 455 XVec2<T,14> wz, ab, qp; 456 XVec2<T,15> ww, aa, qq; 457 XVec3<T,0> xxx, rrr, sss; 458 XVec3<T,1> xxy, rrg, sst; 459 XVec3<T,2> xxz, rrb, ssp; 460 XVec3<T,3> xxw, rra, ssq; 461 XVec3<T,4> xyx, rgr, sts; 462 XVec3<T,5> xyy, rgg, stt; 463 XVec3<T,6> xyz, rgb, stp; 464 XVec3<T,7> xyw, rga, stq; 465 XVec3<T,8> xzx, rbr, sps; 466 XVec3<T,9> xzy, rbg, spt; 467 XVec3<T,10> xzz, rbb, spp; 468 XVec3<T,11> xzw, rba, spq; 469 XVec3<T,12> xwx, rar, sqs; 470 XVec3<T,13> xwy, rag, sqt; 471 XVec3<T,14> xwz, rab, sqp; 472 XVec3<T,15> xww, raa, sqq; 473 XVec3<T,16> yxx, grr, tss; 474 XVec3<T,17> yxy, grg, tst; 475 XVec3<T,18> yxz, grb, tsp; 476 XVec3<T,19> yxw, gra, tsq; 477 XVec3<T,20> yyx, ggr, tts; 478 XVec3<T,21> yyy, ggg, ttt; 479 XVec3<T,22> yyz, ggb, ttp; 480 XVec3<T,23> yyw, gga, ttq; 481 XVec3<T,24> yzx, gbr, tps; 482 XVec3<T,25> yzy, gbg, tpt; 483 XVec3<T,26> yzz, gbb, tpp; 484 XVec3<T,27> yzw, gba, tpq; 485 XVec3<T,28> ywx, gar, tqs; 486 XVec3<T,29> ywy, gag, tqt; 487 XVec3<T,30> ywz, gab, tqp; 488 XVec3<T,31> yww, gaa, tqq; 489 XVec3<T,32> zxx, brr, pss; 490 XVec3<T,33> zxy, brg, pst; 491 XVec3<T,34> zxz, brb, psp; 492 XVec3<T,35> zxw, bra, psq; 493 XVec3<T,36> zyx, bgr, pts; 494 XVec3<T,37> zyy, bgg, ptt; 495 XVec3<T,38> zyz, bgb, ptp; 496 XVec3<T,39> zyw, bga, ptq; 497 XVec3<T,40> zzx, bbr, pps; 498 XVec3<T,41> zzy, bbg, ppt; 499 XVec3<T,42> zzz, bbb, ppp; 500 XVec3<T,43> zzw, bba, ppq; 501 XVec3<T,44> zwx, bar, pqs; 502 XVec3<T,45> zwy, bag, pqt; 503 XVec3<T,46> zwz, bab, pqp; 504 XVec3<T,47> zww, baa, pqq; 505 XVec3<T,48> wxx, arr, qss; 506 XVec3<T,49> wxy, arg, qst; 507 XVec3<T,50> wxz, arb, qsp; 508 XVec3<T,51> wxw, ara, qsq; 509 XVec3<T,52> wyx, agr, qts; 510 XVec3<T,53> wyy, agg, qtt; 511 XVec3<T,54> wyz, agb, qtp; 512 XVec3<T,55> wyw, aga, qtq; 513 XVec3<T,56> wzx, abr, qps; 514 XVec3<T,57> wzy, abg, qpt; 515 XVec3<T,58> wzz, abb, qpp; 516 XVec3<T,59> wzw, aba, qpq; 517 XVec3<T,60> wwx, aar, qqs; 518 XVec3<T,61> wwy, aag, qqt; 519 XVec3<T,62> wwz, aab, qqp; 520 XVec3<T,63> www, aaa, qqq; 521 XVec4<T,0> xxxx, rrrr, ssss; 522 XVec4<T,1> xxxy, rrrg, ssst; 523 XVec4<T,2> xxxz, rrrb, sssp; 524 XVec4<T,3> xxxw, rrra, sssq; 525 XVec4<T,4> xxyx, rrgr, ssts; 526 XVec4<T,5> xxyy, rrgg, sstt; 527 XVec4<T,6> xxyz, rrgb, sstp; 528 XVec4<T,7> xxyw, rrga, sstq; 529 XVec4<T,8> xxzx, rrbr, ssps; 530 XVec4<T,9> xxzy, rrbg, sspt; 531 XVec4<T,10> xxzz, rrbb, sspp; 532 XVec4<T,11> xxzw, rrba, sspq; 533 XVec4<T,12> xxwx, rrar, ssqs; 534 XVec4<T,13> xxwy, rrag, ssqt; 535 XVec4<T,14> xxwz, rrab, ssqp; 536 XVec4<T,15> xxww, rraa, ssqq; 537 XVec4<T,16> xyxx, rgrr, stss; 538 XVec4<T,17> xyxy, rgrg, stst; 539 XVec4<T,18> xyxz, rgrb, stsp; 540 XVec4<T,19> xyxw, rgra, stsq; 541 XVec4<T,20> xyyx, rggr, stts; 542 XVec4<T,21> xyyy, rggg, sttt; 543 XVec4<T,22> xyyz, rggb, sttp; 544 XVec4<T,23> xyyw, rgga, sttq; 545 XVec4<T,24> xyzx, rgbr, stps; 546 XVec4<T,25> xyzy, rgbg, stpt; 547 XVec4<T,26> xyzz, rgbb, stpp; 548 XVec4<T,27> xyzw, rgba, stpq; 549 XVec4<T,28> xywx, rgar, stqs; 550 XVec4<T,29> xywy, rgag, stqt; 551 XVec4<T,30> xywz, rgab, stqp; 552 XVec4<T,31> xyww, rgaa, stqq; 553 XVec4<T,32> xzxx, rbrr, spss; 554 XVec4<T,33> xzxy, rbrg, spst; 555 XVec4<T,34> xzxz, rbrb, spsp; 556 XVec4<T,35> xzxw, rbra, spsq; 557 XVec4<T,36> xzyx, rbgr, spts; 558 XVec4<T,37> xzyy, rbgg, sptt; 559 XVec4<T,38> xzyz, rbgb, sptp; 560 XVec4<T,39> xzyw, rbga, sptq; 561 XVec4<T,40> xzzx, rbbr, spps; 562 XVec4<T,41> xzzy, rbbg, sppt; 563 XVec4<T,42> xzzz, rbbb, sppp; 564 XVec4<T,43> xzzw, rbba, sppq; 565 XVec4<T,44> xzwx, rbar, spqs; 566 XVec4<T,45> xzwy, rbag, spqt; 567 XVec4<T,46> xzwz, rbab, spqp; 568 XVec4<T,47> xzww, rbaa, spqq; 569 XVec4<T,48> xwxx, rarr, sqss; 570 XVec4<T,49> xwxy, rarg, sqst; 571 XVec4<T,50> xwxz, rarb, sqsp; 572 XVec4<T,51> xwxw, rara, sqsq; 573 XVec4<T,52> xwyx, ragr, sqts; 574 XVec4<T,53> xwyy, ragg, sqtt; 575 XVec4<T,54> xwyz, ragb, sqtp; 576 XVec4<T,55> xwyw, raga, sqtq; 577 XVec4<T,56> xwzx, rabr, sqps; 578 XVec4<T,57> xwzy, rabg, sqpt; 579 XVec4<T,58> xwzz, rabb, sqpp; 580 XVec4<T,59> xwzw, raba, sqpq; 581 XVec4<T,60> xwwx, raar, sqqs; 582 XVec4<T,61> xwwy, raag, sqqt; 583 XVec4<T,62> xwwz, raab, sqqp; 584 XVec4<T,63> xwww, raaa, sqqq; 585 XVec4<T,64> yxxx, grrr, tsss; 586 XVec4<T,65> yxxy, grrg, tsst; 587 XVec4<T,66> yxxz, grrb, tssp; 588 XVec4<T,67> yxxw, grra, tssq; 589 XVec4<T,68> yxyx, grgr, tsts; 590 XVec4<T,69> yxyy, grgg, tstt; 591 XVec4<T,70> yxyz, grgb, tstp; 592 XVec4<T,71> yxyw, grga, tstq; 593 XVec4<T,72> yxzx, grbr, tsps; 594 XVec4<T,73> yxzy, grbg, tspt; 595 XVec4<T,74> yxzz, grbb, tspp; 596 XVec4<T,75> yxzw, grba, tspq; 597 XVec4<T,76> yxwx, grar, tsqs; 598 XVec4<T,77> yxwy, grag, tsqt; 599 XVec4<T,78> yxwz, grab, tsqp; 600 XVec4<T,79> yxww, graa, tsqq; 601 XVec4<T,80> yyxx, ggrr, ttss; 602 XVec4<T,81> yyxy, ggrg, ttst; 603 XVec4<T,82> yyxz, ggrb, ttsp; 604 XVec4<T,83> yyxw, ggra, ttsq; 605 XVec4<T,84> yyyx, gggr, ttts; 606 XVec4<T,85> yyyy, gggg, tttt; 607 XVec4<T,86> yyyz, gggb, tttp; 608 XVec4<T,87> yyyw, ggga, tttq; 609 XVec4<T,88> yyzx, ggbr, ttps; 610 XVec4<T,89> yyzy, ggbg, ttpt; 611 XVec4<T,90> yyzz, ggbb, ttpp; 612 XVec4<T,91> yyzw, ggba, ttpq; 613 XVec4<T,92> yywx, ggar, ttqs; 614 XVec4<T,93> yywy, ggag, ttqt; 615 XVec4<T,94> yywz, ggab, ttqp; 616 XVec4<T,95> yyww, ggaa, ttqq; 617 XVec4<T,96> yzxx, gbrr, tpss; 618 XVec4<T,97> yzxy, gbrg, tpst; 619 XVec4<T,98> yzxz, gbrb, tpsp; 620 XVec4<T,99> yzxw, gbra, tpsq; 621 XVec4<T,100> yzyx, gbgr, tpts; 622 XVec4<T,101> yzyy, gbgg, tptt; 623 XVec4<T,102> yzyz, gbgb, tptp; 624 XVec4<T,103> yzyw, gbga, tptq; 625 XVec4<T,104> yzzx, gbbr, tpps; 626 XVec4<T,105> yzzy, gbbg, tppt; 627 XVec4<T,106> yzzz, gbbb, tppp; 628 XVec4<T,107> yzzw, gbba, tppq; 629 XVec4<T,108> yzwx, gbar, tpqs; 630 XVec4<T,109> yzwy, gbag, tpqt; 631 XVec4<T,110> yzwz, gbab, tpqp; 632 XVec4<T,111> yzww, gbaa, tpqq; 633 XVec4<T,112> ywxx, garr, tqss; 634 XVec4<T,113> ywxy, garg, tqst; 635 XVec4<T,114> ywxz, garb, tqsp; 636 XVec4<T,115> ywxw, gara, tqsq; 637 XVec4<T,116> ywyx, gagr, tqts; 638 XVec4<T,117> ywyy, gagg, tqtt; 639 XVec4<T,118> ywyz, gagb, tqtp; 640 XVec4<T,119> ywyw, gaga, tqtq; 641 XVec4<T,120> ywzx, gabr, tqps; 642 XVec4<T,121> ywzy, gabg, tqpt; 643 XVec4<T,122> ywzz, gabb, tqpp; 644 XVec4<T,123> ywzw, gaba, tqpq; 645 XVec4<T,124> ywwx, gaar, tqqs; 646 XVec4<T,125> ywwy, gaag, tqqt; 647 XVec4<T,126> ywwz, gaab, tqqp; 648 XVec4<T,127> ywww, gaaa, tqqq; 649 XVec4<T,128> zxxx, brrr, psss; 650 XVec4<T,129> zxxy, brrg, psst; 651 XVec4<T,130> zxxz, brrb, pssp; 652 XVec4<T,131> zxxw, brra, pssq; 653 XVec4<T,132> zxyx, brgr, psts; 654 XVec4<T,133> zxyy, brgg, pstt; 655 XVec4<T,134> zxyz, brgb, pstp; 656 XVec4<T,135> zxyw, brga, pstq; 657 XVec4<T,136> zxzx, brbr, psps; 658 XVec4<T,137> zxzy, brbg, pspt; 659 XVec4<T,138> zxzz, brbb, pspp; 660 XVec4<T,139> zxzw, brba, pspq; 661 XVec4<T,140> zxwx, brar, psqs; 662 XVec4<T,141> zxwy, brag, psqt; 663 XVec4<T,142> zxwz, brab, psqp; 664 XVec4<T,143> zxww, braa, psqq; 665 XVec4<T,144> zyxx, bgrr, ptss; 666 XVec4<T,145> zyxy, bgrg, ptst; 667 XVec4<T,146> zyxz, bgrb, ptsp; 668 XVec4<T,147> zyxw, bgra, ptsq; 669 XVec4<T,148> zyyx, bggr, ptts; 670 XVec4<T,149> zyyy, bggg, pttt; 671 XVec4<T,150> zyyz, bggb, pttp; 672 XVec4<T,151> zyyw, bgga, pttq; 673 XVec4<T,152> zyzx, bgbr, ptps; 674 XVec4<T,153> zyzy, bgbg, ptpt; 675 XVec4<T,154> zyzz, bgbb, ptpp; 676 XVec4<T,155> zyzw, bgba, ptpq; 677 XVec4<T,156> zywx, bgar, ptqs; 678 XVec4<T,157> zywy, bgag, ptqt; 679 XVec4<T,158> zywz, bgab, ptqp; 680 XVec4<T,159> zyww, bgaa, ptqq; 681 XVec4<T,160> zzxx, bbrr, ppss; 682 XVec4<T,161> zzxy, bbrg, ppst; 683 XVec4<T,162> zzxz, bbrb, ppsp; 684 XVec4<T,163> zzxw, bbra, ppsq; 685 XVec4<T,164> zzyx, bbgr, ppts; 686 XVec4<T,165> zzyy, bbgg, pptt; 687 XVec4<T,166> zzyz, bbgb, pptp; 688 XVec4<T,167> zzyw, bbga, pptq; 689 XVec4<T,168> zzzx, bbbr, ppps; 690 XVec4<T,169> zzzy, bbbg, pppt; 691 XVec4<T,170> zzzz, bbbb, pppp; 692 XVec4<T,171> zzzw, bbba, pppq; 693 XVec4<T,172> zzwx, bbar, ppqs; 694 XVec4<T,173> zzwy, bbag, ppqt; 695 XVec4<T,174> zzwz, bbab, ppqp; 696 XVec4<T,175> zzww, bbaa, ppqq; 697 XVec4<T,176> zwxx, barr, pqss; 698 XVec4<T,177> zwxy, barg, pqst; 699 XVec4<T,178> zwxz, barb, pqsp; 700 XVec4<T,179> zwxw, bara, pqsq; 701 XVec4<T,180> zwyx, bagr, pqts; 702 XVec4<T,181> zwyy, bagg, pqtt; 703 XVec4<T,182> zwyz, bagb, pqtp; 704 XVec4<T,183> zwyw, baga, pqtq; 705 XVec4<T,184> zwzx, babr, pqps; 706 XVec4<T,185> zwzy, babg, pqpt; 707 XVec4<T,186> zwzz, babb, pqpp; 708 XVec4<T,187> zwzw, baba, pqpq; 709 XVec4<T,188> zwwx, baar, pqqs; 710 XVec4<T,189> zwwy, baag, pqqt; 711 XVec4<T,190> zwwz, baab, pqqp; 712 XVec4<T,191> zwww, baaa, pqqq; 713 XVec4<T,192> wxxx, arrr, qsss; 714 XVec4<T,193> wxxy, arrg, qsst; 715 XVec4<T,194> wxxz, arrb, qssp; 716 XVec4<T,195> wxxw, arra, qssq; 717 XVec4<T,196> wxyx, argr, qsts; 718 XVec4<T,197> wxyy, argg, qstt; 719 XVec4<T,198> wxyz, argb, qstp; 720 XVec4<T,199> wxyw, arga, qstq; 721 XVec4<T,200> wxzx, arbr, qsps; 722 XVec4<T,201> wxzy, arbg, qspt; 723 XVec4<T,202> wxzz, arbb, qspp; 724 XVec4<T,203> wxzw, arba, qspq; 725 XVec4<T,204> wxwx, arar, qsqs; 726 XVec4<T,205> wxwy, arag, qsqt; 727 XVec4<T,206> wxwz, arab, qsqp; 728 XVec4<T,207> wxww, araa, qsqq; 729 XVec4<T,208> wyxx, agrr, qtss; 730 XVec4<T,209> wyxy, agrg, qtst; 731 XVec4<T,210> wyxz, agrb, qtsp; 732 XVec4<T,211> wyxw, agra, qtsq; 733 XVec4<T,212> wyyx, aggr, qtts; 734 XVec4<T,213> wyyy, aggg, qttt; 735 XVec4<T,214> wyyz, aggb, qttp; 736 XVec4<T,215> wyyw, agga, qttq; 737 XVec4<T,216> wyzx, agbr, qtps; 738 XVec4<T,217> wyzy, agbg, qtpt; 739 XVec4<T,218> wyzz, agbb, qtpp; 740 XVec4<T,219> wyzw, agba, qtpq; 741 XVec4<T,220> wywx, agar, qtqs; 742 XVec4<T,221> wywy, agag, qtqt; 743 XVec4<T,222> wywz, agab, qtqp; 744 XVec4<T,223> wyww, agaa, qtqq; 745 XVec4<T,224> wzxx, abrr, qpss; 746 XVec4<T,225> wzxy, abrg, qpst; 747 XVec4<T,226> wzxz, abrb, qpsp; 748 XVec4<T,227> wzxw, abra, qpsq; 749 XVec4<T,228> wzyx, abgr, qpts; 750 XVec4<T,229> wzyy, abgg, qptt; 751 XVec4<T,230> wzyz, abgb, qptp; 752 XVec4<T,231> wzyw, abga, qptq; 753 XVec4<T,232> wzzx, abbr, qpps; 754 XVec4<T,233> wzzy, abbg, qppt; 755 XVec4<T,234> wzzz, abbb, qppp; 756 XVec4<T,235> wzzw, abba, qppq; 757 XVec4<T,236> wzwx, abar, qpqs; 758 XVec4<T,237> wzwy, abag, qpqt; 759 XVec4<T,238> wzwz, abab, qpqp; 760 XVec4<T,239> wzww, abaa, qpqq; 761 XVec4<T,240> wwxx, aarr, qqss; 762 XVec4<T,241> wwxy, aarg, qqst; 763 XVec4<T,242> wwxz, aarb, qqsp; 764 XVec4<T,243> wwxw, aara, qqsq; 765 XVec4<T,244> wwyx, aagr, qqts; 766 XVec4<T,245> wwyy, aagg, qqtt; 767 XVec4<T,246> wwyz, aagb, qqtp; 768 XVec4<T,247> wwyw, aaga, qqtq; 769 XVec4<T,248> wwzx, aabr, qqps; 770 XVec4<T,249> wwzy, aabg, qqpt; 771 XVec4<T,250> wwzz, aabb, qqpp; 772 XVec4<T,251> wwzw, aaba, qqpq; 773 XVec4<T,252> wwwx, aaar, qqqs; 774 XVec4<T,253> wwwy, aaag, qqqt; 775 XVec4<T,254> wwwz, aaab, qqqp; 776 XVec4<T,255> wwww, aaaa, qqqq; 805 777 }; 806 778 }; … … 812 784 template <typename T> struct Quat 813 785 { 814 typedef Quat<T> type_t; 815 816 inline Quat() { } 817 inline Quat(T val) : x(0), y(0), z(0), w(val) { } 818 inline Quat(T _x, T _y, T _z, T _w) : x(_x), y(_y), z(_z), w(_w) { } 786 inline Quat() {} 787 inline Quat(T X) : x(0), y(0), z(0), w(X) {} 788 inline Quat(T X, T Y, T Z, T W) : x(X), y(Y), z(Z), w(W) {} 819 789 820 790 Quat(Mat4<T> const &m); … … 822 792 MEMBER_OPS() 823 793 824 QUATERNION_OPS() 794 inline Quat<T> operator *(Quat<T> const &val) const 795 { 796 Quat<T> ret; 797 Vec3<T> v1(x, y, z); 798 Vec3<T> v2(val.x, val.y, val.z); 799 Vec3<T> v3 = cross(v1, v2) + w * v2 + val.w * v1; 800 ret.x = v3.x; 801 ret.y = v3.y; 802 ret.z = v3.z; 803 ret.w = w * val.w  dot(v1, v2); 804 return ret; 805 } 806 807 inline Quat<T> operator *=(Quat<T> const &val) 808 { 809 return *this = (*this) * val; 810 } 811 812 inline Quat<T> operator ~() const 813 { 814 Quat<T> ret; 815 for (int n = 0; n < 3; n++) 816 ret[n] = (*this)[n]; 817 ret[3] = (*this)[3]; 818 return ret; 819 } 825 820 826 821 #if !defined __ANDROID__ … … 1009 1004 1010 1005 /* 1011 * Magic swizzling (part 2/2)1006 * Magic vector swizzling (part 2/2) 1012 1007 */ 1013 1008 1014 template<typename T, int I, int J>1015 inline Vec2<T> MagicVec2<T, I, J>::operator =(Vec2<T> that)1009 template<typename T, int N> 1010 inline Vec2<T> XVec2<T, N>::operator =(Vec2<T> that) 1016 1011 { 1017 1012 ptr[I] = that.x; ptr[J] = that.y; … … 1019 1014 } 1020 1015 1021 template<typename T, int I, int J, int K>1022 inline Vec3<T> MagicVec3<T, I, J, K>::operator =(Vec3<T> that)1016 template<typename T, int N> 1017 inline Vec3<T> XVec3<T, N>::operator =(Vec3<T> that) 1023 1018 { 1024 1019 ptr[I] = that.x; ptr[J] = that.y; ptr[K] = that.z; … … 1026 1021 } 1027 1022 1028 template<typename T, int I, int J, int K, int L>1029 inline Vec4<T> MagicVec4<T, I, J, K, L>::operator =(Vec4<T> that)1023 template<typename T, int N> 1024 inline Vec4<T> XVec4<T, N>::operator =(Vec4<T> that) 1030 1025 { 1031 1026 ptr[I] = that.x; ptr[J] = that.y; ptr[K] = that.z; ptr[L] = that.w; … … 1039 1034 template <typename T> struct Mat4 1040 1035 { 1041 typedef Mat4<T> type_t; 1042 1043 inline Mat4() { } 1036 inline Mat4() {} 1044 1037 explicit inline Mat4(T val) 1045 1038 {
Note: See TracChangeset
for help on using the changeset viewer.