All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Go to the documentation of this file.
15 #ifndef G3D_Vector4_h
16 #define G3D_Vector4_h
18 #include "G3D/platform.h"
19 #include "G3D/g3dmath.h"
20 #include "G3D/Vector3.h"
21 #include "G3D/Vector2.h"
22 #include "G3D/Table.h"
23 #include "G3D/HashTrait.h"
24 #include "G3D/PositionTrait.h"
25 #include <string>
27 namespace G3D {
29 class Vector2;
30 class Vector3;
31 class Vector4;
32 class Vector4int8;
33 class Any;
39 class Vector4 {
40 private:
41  // Hidden operators
42  bool operator<(const Vector4&) const;
43  bool operator>(const Vector4&) const;
44  bool operator<=(const Vector4&) const;
45  bool operator>=(const Vector4&) const;
47 public:
50  explicit Vector4(const Any& any);
52  Vector4& operator=(const Any& a);
54  Any toAny() const;
56  // construction
57  Vector4();
58  Vector4(float fX, float fY, float fZ, float fW);
59  Vector4(float afCoordinate[4]);
60  Vector4(const Vector4& rkVector);
61  Vector4(const class Color4& c);
62  Vector4(const Vector3& rkVector, float fW);
63  Vector4(const Vector2& v1, const Vector2& v2);
64  Vector4(const Vector2& v1, float fz, float fw);
67  Vector4(const Vector4int8&);
69  Vector4(class BinaryInput& b);
70  void serialize(class BinaryOutput& b) const;
71  void deserialize(class BinaryInput& b);
73  // coordinates
74  float x, y, z, w;
76  // access vector V as V[0] = V.x, V[1] = V.y, V[2] = V.z, etc.
77  //
78  // WARNING. These member functions rely on
79  // (1) Vector4 not having virtual functions
80  // (2) the data packed in a 4*sizeof(float) memory block
81  float& operator[] (int i);
82  const float& operator[] (int i) const;
84  // assignment and comparison
85  Vector4& operator= (const Vector4& rkVector);
86  bool operator== (const Vector4& rkVector) const;
87  bool operator!= (const Vector4& rkVector) const;
89  static const Vector4& zero();
91  inline void set(float _x, float _y, float _z, float _w) {
92  x = _x;
93  y = _y;
94  z = _z;
95  w = _w;
96  }
98  inline void set(const Vector3& v, float _w) {
99  x = v.x;
100  y = v.y;
101  z = v.z;
102  w = _w;
103  }
105  inline void set(const Vector2& v, float _z, float _w) {
106  x = v.x;
107  y = v.y;
108  z = _z;
109  w = _w;
110  }
112  size_t hashCode() const;
113  bool fuzzyEq(const Vector4& other) const;
114  bool fuzzyNe(const Vector4& other) const;
116  static const Vector4& inf();
117  static const Vector4& nan();
120  float length() const;
121  float squaredLength() const;
123  inline float sum() const {
124  return x + y + z + w;
125  }
128  bool isFinite() const;
131  bool isZero() const;
134  bool isUnit() const;
136  // arithmetic operations
137  Vector4 operator+ (const Vector4& rkVector) const;
138  Vector4 operator- (const Vector4& rkVector) const;
140  inline Vector4 operator*(const Vector4& rkVector) const {
141  return Vector4(x * rkVector.x, y * rkVector.y, z * rkVector.z, w * rkVector.w);
142  }
144  inline Vector4 operator/(const Vector4& rkVector) const {
145  return Vector4(x / rkVector.x, y / rkVector.y, z / rkVector.z, w / rkVector.w);
146  }
148  Vector4 operator*(const class Matrix4& M) const;
150  Vector4 operator* (float fScalar) const;
151  Vector4 operator/ (float fScalar) const;
152  Vector4 operator- () const;
153  friend Vector4 operator* (float, const Vector4& rkVector);
155  // arithmetic updates
156  Vector4& operator+= (const Vector4& rkVector);
157  Vector4& operator-= (const Vector4& rkVector);
158  Vector4& operator*= (float fScalar);
159  Vector4& operator/= (float fScalar);
161  inline Vector4 clamp(const Vector4& low, const Vector4& high) const {
162  return Vector4(
163  G3D::clamp(x, low.x, high.x),
164  G3D::clamp(y, low.y, high.y),
165  G3D::clamp(z, low.z, high.z),
166  G3D::clamp(w, low.w, high.w));
167  }
169  inline Vector4 clamp(float low, float high) const {
170  return Vector4(
171  G3D::clamp(x, low, high),
172  G3D::clamp(y, low, high),
173  G3D::clamp(z, low, high),
174  G3D::clamp(w, low, high));
175  }
177  float dot (const Vector4& rkVector) const;
179  Vector4 min(const Vector4& v) const;
180  Vector4 max(const Vector4& v) const;
182  std::string toString() const;
187  Vector4 lerp(const Vector4& v, float alpha) const;
189  // 2-char swizzles
191  Vector2 xx() const;
192  Vector2 yx() const;
193  Vector2 zx() const;
194  Vector2 wx() const;
195  Vector2 xy() const;
196  Vector2 yy() const;
197  Vector2 zy() const;
198  Vector2 wy() const;
199  Vector2 xz() const;
200  Vector2 yz() const;
201  Vector2 zz() const;
202  Vector2 wz() const;
203  Vector2 xw() const;
204  Vector2 yw() const;
205  Vector2 zw() const;
206  Vector2 ww() const;
208  // 3-char swizzles
210  Vector3 xxx() const;
211  Vector3 yxx() const;
212  Vector3 zxx() const;
213  Vector3 wxx() const;
214  Vector3 xyx() const;
215  Vector3 yyx() const;
216  Vector3 zyx() const;
217  Vector3 wyx() const;
218  Vector3 xzx() const;
219  Vector3 yzx() const;
220  Vector3 zzx() const;
221  Vector3 wzx() const;
222  Vector3 xwx() const;
223  Vector3 ywx() const;
224  Vector3 zwx() const;
225  Vector3 wwx() const;
226  Vector3 xxy() const;
227  Vector3 yxy() const;
228  Vector3 zxy() const;
229  Vector3 wxy() const;
230  Vector3 xyy() const;
231  Vector3 yyy() const;
232  Vector3 zyy() const;
233  Vector3 wyy() const;
234  Vector3 xzy() const;
235  Vector3 yzy() const;
236  Vector3 zzy() const;
237  Vector3 wzy() const;
238  Vector3 xwy() const;
239  Vector3 ywy() const;
240  Vector3 zwy() const;
241  Vector3 wwy() const;
242  Vector3 xxz() const;
243  Vector3 yxz() const;
244  Vector3 zxz() const;
245  Vector3 wxz() const;
246  Vector3 xyz() const;
247  Vector3 yyz() const;
248  Vector3 zyz() const;
249  Vector3 wyz() const;
250  Vector3 xzz() const;
251  Vector3 yzz() const;
252  Vector3 zzz() const;
253  Vector3 wzz() const;
254  Vector3 xwz() const;
255  Vector3 ywz() const;
256  Vector3 zwz() const;
257  Vector3 wwz() const;
258  Vector3 xxw() const;
259  Vector3 yxw() const;
260  Vector3 zxw() const;
261  Vector3 wxw() const;
262  Vector3 xyw() const;
263  Vector3 yyw() const;
264  Vector3 zyw() const;
265  Vector3 wyw() const;
266  Vector3 xzw() const;
267  Vector3 yzw() const;
268  Vector3 zzw() const;
269  Vector3 wzw() const;
270  Vector3 xww() const;
271  Vector3 yww() const;
272  Vector3 zww() const;
273  Vector3 www() const;
275  // 4-char swizzles
277  Vector4 xxxx() const;
278  Vector4 yxxx() const;
279  Vector4 zxxx() const;
280  Vector4 wxxx() const;
281  Vector4 xyxx() const;
282  Vector4 yyxx() const;
283  Vector4 zyxx() const;
284  Vector4 wyxx() const;
285  Vector4 xzxx() const;
286  Vector4 yzxx() const;
287  Vector4 zzxx() const;
288  Vector4 wzxx() const;
289  Vector4 xwxx() const;
290  Vector4 ywxx() const;
291  Vector4 zwxx() const;
292  Vector4 wwxx() const;
293  Vector4 xxyx() const;
294  Vector4 yxyx() const;
295  Vector4 zxyx() const;
296  Vector4 wxyx() const;
297  Vector4 xyyx() const;
298  Vector4 yyyx() const;
299  Vector4 zyyx() const;
300  Vector4 wyyx() const;
301  Vector4 xzyx() const;
302  Vector4 yzyx() const;
303  Vector4 zzyx() const;
304  Vector4 wzyx() const;
305  Vector4 xwyx() const;
306  Vector4 ywyx() const;
307  Vector4 zwyx() const;
308  Vector4 wwyx() const;
309  Vector4 xxzx() const;
310  Vector4 yxzx() const;
311  Vector4 zxzx() const;
312  Vector4 wxzx() const;
313  Vector4 xyzx() const;
314  Vector4 yyzx() const;
315  Vector4 zyzx() const;
316  Vector4 wyzx() const;
317  Vector4 xzzx() const;
318  Vector4 yzzx() const;
319  Vector4 zzzx() const;
320  Vector4 wzzx() const;
321  Vector4 xwzx() const;
322  Vector4 ywzx() const;
323  Vector4 zwzx() const;
324  Vector4 wwzx() const;
325  Vector4 xxwx() const;
326  Vector4 yxwx() const;
327  Vector4 zxwx() const;
328  Vector4 wxwx() const;
329  Vector4 xywx() const;
330  Vector4 yywx() const;
331  Vector4 zywx() const;
332  Vector4 wywx() const;
333  Vector4 xzwx() const;
334  Vector4 yzwx() const;
335  Vector4 zzwx() const;
336  Vector4 wzwx() const;
337  Vector4 xwwx() const;
338  Vector4 ywwx() const;
339  Vector4 zwwx() const;
340  Vector4 wwwx() const;
341  Vector4 xxxy() const;
342  Vector4 yxxy() const;
343  Vector4 zxxy() const;
344  Vector4 wxxy() const;
345  Vector4 xyxy() const;
346  Vector4 yyxy() const;
347  Vector4 zyxy() const;
348  Vector4 wyxy() const;
349  Vector4 xzxy() const;
350  Vector4 yzxy() const;
351  Vector4 zzxy() const;
352  Vector4 wzxy() const;
353  Vector4 xwxy() const;
354  Vector4 ywxy() const;
355  Vector4 zwxy() const;
356  Vector4 wwxy() const;
357  Vector4 xxyy() const;
358  Vector4 yxyy() const;
359  Vector4 zxyy() const;
360  Vector4 wxyy() const;
361  Vector4 xyyy() const;
362  Vector4 yyyy() const;
363  Vector4 zyyy() const;
364  Vector4 wyyy() const;
365  Vector4 xzyy() const;
366  Vector4 yzyy() const;
367  Vector4 zzyy() const;
368  Vector4 wzyy() const;
369  Vector4 xwyy() const;
370  Vector4 ywyy() const;
371  Vector4 zwyy() const;
372  Vector4 wwyy() const;
373  Vector4 xxzy() const;
374  Vector4 yxzy() const;
375  Vector4 zxzy() const;
376  Vector4 wxzy() const;
377  Vector4 xyzy() const;
378  Vector4 yyzy() const;
379  Vector4 zyzy() const;
380  Vector4 wyzy() const;
381  Vector4 xzzy() const;
382  Vector4 yzzy() const;
383  Vector4 zzzy() const;
384  Vector4 wzzy() const;
385  Vector4 xwzy() const;
386  Vector4 ywzy() const;
387  Vector4 zwzy() const;
388  Vector4 wwzy() const;
389  Vector4 xxwy() const;
390  Vector4 yxwy() const;
391  Vector4 zxwy() const;
392  Vector4 wxwy() const;
393  Vector4 xywy() const;
394  Vector4 yywy() const;
395  Vector4 zywy() const;
396  Vector4 wywy() const;
397  Vector4 xzwy() const;
398  Vector4 yzwy() const;
399  Vector4 zzwy() const;
400  Vector4 wzwy() const;
401  Vector4 xwwy() const;
402  Vector4 ywwy() const;
403  Vector4 zwwy() const;
404  Vector4 wwwy() const;
405  Vector4 xxxz() const;
406  Vector4 yxxz() const;
407  Vector4 zxxz() const;
408  Vector4 wxxz() const;
409  Vector4 xyxz() const;
410  Vector4 yyxz() const;
411  Vector4 zyxz() const;
412  Vector4 wyxz() const;
413  Vector4 xzxz() const;
414  Vector4 yzxz() const;
415  Vector4 zzxz() const;
416  Vector4 wzxz() const;
417  Vector4 xwxz() const;
418  Vector4 ywxz() const;
419  Vector4 zwxz() const;
420  Vector4 wwxz() const;
421  Vector4 xxyz() const;
422  Vector4 yxyz() const;
423  Vector4 zxyz() const;
424  Vector4 wxyz() const;
425  Vector4 xyyz() const;
426  Vector4 yyyz() const;
427  Vector4 zyyz() const;
428  Vector4 wyyz() const;
429  Vector4 xzyz() const;
430  Vector4 yzyz() const;
431  Vector4 zzyz() const;
432  Vector4 wzyz() const;
433  Vector4 xwyz() const;
434  Vector4 ywyz() const;
435  Vector4 zwyz() const;
436  Vector4 wwyz() const;
437  Vector4 xxzz() const;
438  Vector4 yxzz() const;
439  Vector4 zxzz() const;
440  Vector4 wxzz() const;
441  Vector4 xyzz() const;
442  Vector4 yyzz() const;
443  Vector4 zyzz() const;
444  Vector4 wyzz() const;
445  Vector4 xzzz() const;
446  Vector4 yzzz() const;
447  Vector4 zzzz() const;
448  Vector4 wzzz() const;
449  Vector4 xwzz() const;
450  Vector4 ywzz() const;
451  Vector4 zwzz() const;
452  Vector4 wwzz() const;
453  Vector4 xxwz() const;
454  Vector4 yxwz() const;
455  Vector4 zxwz() const;
456  Vector4 wxwz() const;
457  Vector4 xywz() const;
458  Vector4 yywz() const;
459  Vector4 zywz() const;
460  Vector4 wywz() const;
461  Vector4 xzwz() const;
462  Vector4 yzwz() const;
463  Vector4 zzwz() const;
464  Vector4 wzwz() const;
465  Vector4 xwwz() const;
466  Vector4 ywwz() const;
467  Vector4 zwwz() const;
468  Vector4 wwwz() const;
469  Vector4 xxxw() const;
470  Vector4 yxxw() const;
471  Vector4 zxxw() const;
472  Vector4 wxxw() const;
473  Vector4 xyxw() const;
474  Vector4 yyxw() const;
475  Vector4 zyxw() const;
476  Vector4 wyxw() const;
477  Vector4 xzxw() const;
478  Vector4 yzxw() const;
479  Vector4 zzxw() const;
480  Vector4 wzxw() const;
481  Vector4 xwxw() const;
482  Vector4 ywxw() const;
483  Vector4 zwxw() const;
484  Vector4 wwxw() const;
485  Vector4 xxyw() const;
486  Vector4 yxyw() const;
487  Vector4 zxyw() const;
488  Vector4 wxyw() const;
489  Vector4 xyyw() const;
490  Vector4 yyyw() const;
491  Vector4 zyyw() const;
492  Vector4 wyyw() const;
493  Vector4 xzyw() const;
494  Vector4 yzyw() const;
495  Vector4 zzyw() const;
496  Vector4 wzyw() const;
497  Vector4 xwyw() const;
498  Vector4 ywyw() const;
499  Vector4 zwyw() const;
500  Vector4 wwyw() const;
501  Vector4 xxzw() const;
502  Vector4 yxzw() const;
503  Vector4 zxzw() const;
504  Vector4 wxzw() const;
505  Vector4 xyzw() const;
506  Vector4 yyzw() const;
507  Vector4 zyzw() const;
508  Vector4 wyzw() const;
509  Vector4 xzzw() const;
510  Vector4 yzzw() const;
511  Vector4 zzzw() const;
512  Vector4 wzzw() const;
513  Vector4 xwzw() const;
514  Vector4 ywzw() const;
515  Vector4 zwzw() const;
516  Vector4 wwzw() const;
517  Vector4 xxww() const;
518  Vector4 yxww() const;
519  Vector4 zxww() const;
520  Vector4 wxww() const;
521  Vector4 xyww() const;
522  Vector4 yyww() const;
523  Vector4 zyww() const;
524  Vector4 wyww() const;
525  Vector4 xzww() const;
526  Vector4 yzww() const;
527  Vector4 zzww() const;
528  Vector4 wzww() const;
529  Vector4 xwww() const;
530  Vector4 ywww() const;
531  Vector4 zwww() const;
532  Vector4 wwww() const;
534 };
537 //----------------------------------------------------------------------------
539  x = y = z = w = 0;
540 }
542 //----------------------------------------------------------------------------
544 inline Vector4::Vector4 (float fX, float fY, float fZ, float fW) {
545  x = fX;
546  y = fY;
547  z = fZ;
548  w = fW;
549 }
551 //----------------------------------------------------------------------------
552 inline Vector4::Vector4 (float afCoordinate[4]) {
553  x = afCoordinate[0];
554  y = afCoordinate[1];
555  z = afCoordinate[2];
556  w = afCoordinate[3];
557 }
559 //----------------------------------------------------------------------------
560 inline Vector4::Vector4(const Vector4& rkVector) {
561  x = rkVector.x;
562  y = rkVector.y;
563  z = rkVector.z;
564  w = rkVector.w;
565 }
566 //----------------------------------------------------------------------------
567 inline Vector4::Vector4(const Vector3& rkVector, float fW) {
568  x = rkVector.x;
569  y = rkVector.y;
570  z = rkVector.z;
571  w = fW;
572 }
574 //----------------------------------------------------------------------------
575 inline float& Vector4::operator[] (int i) {
576  return ((float*)this)[i];
577 }
579 //----------------------------------------------------------------------------
580 inline const float& Vector4::operator[] (int i) const {
581  return ((float*)this)[i];
582 }
584 //----------------------------------------------------------------------------
585 inline Vector4& Vector4::operator= (const Vector4& rkVector) {
586  x = rkVector.x;
587  y = rkVector.y;
588  z = rkVector.z;
589  w = rkVector.w;
590  return *this;
591 }
593 //----------------------------------------------------------------------------
594 inline bool Vector4::operator== (const Vector4& rkVector) const {
595  return ( (x == rkVector.x) && (y == rkVector.y) && (z == rkVector.z) && (w == rkVector.w));
596 }
598 //----------------------------------------------------------------------------
599 inline bool Vector4::operator!= (const Vector4& rkVector) const {
600  return ( x != rkVector.x || y != rkVector.y || z != rkVector.z || w != rkVector.w);
601 }
603 //----------------------------------------------------------------------------
604 inline Vector4 Vector4::operator+ (const Vector4& rkVector) const {
605  return Vector4(x + rkVector.x, y + rkVector.y, z + rkVector.z, w + rkVector.w);
606 }
608 //----------------------------------------------------------------------------
609 inline Vector4 Vector4::operator- (const Vector4& rkVector) const {
610  return Vector4(x - rkVector.x, y - rkVector.y, z - rkVector.z, w - rkVector.w);
611 }
613 //----------------------------------------------------------------------------
614 inline Vector4 Vector4::operator* (float fScalar) const {
615  return Vector4(fScalar*x, fScalar*y, fScalar*z, fScalar*w);
616 }
618 //----------------------------------------------------------------------------
619 inline Vector4 Vector4::operator- () const {
620  return Vector4( -x, -y, -z, -w);
621 }
623 //----------------------------------------------------------------------------
624 inline Vector4& Vector4::operator+= (const Vector4& rkVector) {
625  x += rkVector.x;
626  y += rkVector.y;
627  z += rkVector.z;
628  w += rkVector.w;
629  return *this;
630 }
632 //----------------------------------------------------------------------------
633 inline Vector4& Vector4::operator-= (const Vector4& rkVector) {
634  x -= rkVector.x;
635  y -= rkVector.y;
636  z -= rkVector.z;
637  w -= rkVector.w;
638  return *this;
639 }
641 //----------------------------------------------------------------------------
643 inline Vector4 Vector4::lerp(const Vector4& v, float alpha) const {
644  return (*this) + (v - *this) * alpha;
645 }
648 //----------------------------------------------------------------------------
649 inline Vector4& Vector4::operator*= (float fScalar) {
650  x *= fScalar;
651  y *= fScalar;
652  z *= fScalar;
653  w *= fScalar;
654  return *this;
655 }
658 //----------------------------------------------------------------------------
659 inline float Vector4::dot(const Vector4& rkVector) const {
660  return x*rkVector.x + y*rkVector.y + z*rkVector.z + w*rkVector.w;
661 }
663 //----------------------------------------------------------------------------
664 inline Vector4 Vector4::min(const Vector4 &v) const {
665  return Vector4(G3D::min(v.x, x), G3D::min(v.y, y), G3D::min(v.z, z), G3D::min(v.w, w));
666 }
668 //----------------------------------------------------------------------------
669 inline Vector4 Vector4::max(const Vector4 &v) const {
670  return Vector4(G3D::max(v.x, x), G3D::max(v.y, y), G3D::max(v.z, z), G3D::max(v.w, w));
671 }
673 //----------------------------------------------------------------------------
674 inline bool Vector4::isZero() const {
675  return (x == 0.0f) && (y == 0.0f) && (z == 0.0f) && (w == 0.0f);
676 }
678 //----------------------------------------------------------------------------
680 inline bool Vector4::isFinite() const {
682 }
684 //----------------------------------------------------------------------------
686 inline bool Vector4::isUnit() const {
687  return squaredLength() == 1.0;
688 }
690 //----------------------------------------------------------------------------
692 inline float Vector4::length() const {
693  return sqrtf(squaredLength());
694 }
696 //----------------------------------------------------------------------------
698 inline float Vector4::squaredLength() const {
699  return x * x + y * y + z * z + w * w;
700 }
703 void serialize(const Vector4& v, class BinaryOutput& b);
704 void deserialize(Vector4& v, class BinaryInput& b);
706 } // G3D
708 template <> struct HashTrait<G3D::Vector4> {
709  static size_t hashCode(const G3D::Vector4& key) { return key.hashCode(); }
710 };
713 template<> struct PositionTrait<class G3D::Vector4> {
714  static void getPosition(const G3D::Vector4& v, G3D::Vector3& p) { p =; }
715 };
717 inline G3D::Vector4 operator* (float s, const G3D::Vector4& v) {
718  return v * s;
719 }
721 #endif
Vector4 zxzz() const
Definition: Vector4.cpp:426
Vector4 xwzw() const
Definition: Vector4.cpp:500
Vector4 yzzx() const
Definition: Vector4.cpp:305
Vector4 zwxy() const
Definition: Vector4.cpp:342
static size_t hashCode(const G3D::Vector4 &key)
Definition: Vector4.h:709
Vector4 xwxx() const
Definition: Vector4.cpp:276
Vector4 yzzz() const
Definition: Vector4.cpp:433
Vector4 xzwy() const
Definition: Vector4.cpp:384
Vector4 zyxz() const
Definition: Vector4.cpp:398
Vector4 wyww() const
Definition: Vector4.cpp:511
float length() const
Definition: Vector4.h:692
Vector3 zzz() const
Definition: Vector4.cpp:239
Vector4 zwzz() const
Definition: Vector4.cpp:438
Definition: Vector2.h:40
Vector4 xzxy() const
Definition: Vector4.cpp:336
Vector4 zyyy() const
Definition: Vector4.cpp:350
Vector4 ywxy() const
Definition: Vector4.cpp:341
Vector4 xzyy() const
Definition: Vector4.cpp:352
Vector4 xzzy() const
Definition: Vector4.cpp:368
Vector4 yyyz() const
Definition: Vector4.cpp:413
Vector3 zww() const
Definition: Vector4.cpp:259
float x
Definition: Vector3.h:62
Vector4 wwzw() const
Definition: Vector4.cpp:503
Vector4 wwyz() const
Definition: Vector4.cpp:423
Vector2 zy() const
Definition: Vector4.cpp:184
Vector4 zxxx() const
Definition: Vector4.cpp:266
Vector3 zyy() const
Definition: Vector4.cpp:219
Vector4 zwzy() const
Definition: Vector4.cpp:374
Vector3 ywx() const
Definition: Vector4.cpp:210
Vector4 wyzy() const
Definition: Vector4.cpp:367
Vector3 wzz() const
Definition: Vector4.cpp:240
Vector4 operator/(const Vector4 &rkVector) const
Definition: Vector4.h:144
Vector4 yyzw() const
Definition: Vector4.cpp:493
Vector2 xz() const
Definition: Vector4.cpp:186
Vector2 wy() const
Definition: Vector4.cpp:185
Vector4 xyxy() const
Definition: Vector4.cpp:332
Vector4 yyzy() const
Definition: Vector4.cpp:365
Vector3 yzz() const
Definition: Vector4.cpp:238
Vector4 zxyy() const
Definition: Vector4.cpp:346
Vector4 wzxz() const
Definition: Vector4.cpp:403
Vector4 zxww() const
Definition: Vector4.cpp:506
Vector4 xwzx() const
Definition: Vector4.cpp:308
Vector4 wzzy() const
Definition: Vector4.cpp:371
Vector4 wzzx() const
Definition: Vector4.cpp:307
Vector4 yzwx() const
Definition: Vector4.cpp:321
Vector4 wywz() const
Definition: Vector4.cpp:447
Vector4 ywyz() const
Definition: Vector4.cpp:421
Vector4 xyzz() const
Definition: Vector4.cpp:428
bool isFinite() const
Definition: Vector4.h:680
Vector3 xxx() const
Definition: Vector4.cpp:197
Vector4 ywwx() const
Definition: Vector4.cpp:325
Vector4 wwww() const
Definition: Vector4.cpp:519
Vector4 xxxy() const
Definition: Vector4.cpp:328
Vector4 zzyw() const
Definition: Vector4.cpp:482
Vector4 wyzz() const
Definition: Vector4.cpp:431
Vector4 wzxw() const
Definition: Vector4.cpp:467
Vector4 zzzw() const
Definition: Vector4.cpp:498
Definition: BinaryInput.h:69
Vector4 wwxx() const
Definition: Vector4.cpp:279
float w
Definition: Vector4.h:74
Vector3 zyx() const
Definition: Vector4.cpp:203
G3D::Vector4 operator*(float s, const G3D::Vector4 &v)
Definition: Vector4.h:717
size_t hashCode() const
Definition: Vector4.cpp:78
Vector4 xyxz() const
Definition: Vector4.cpp:396
Any toAny() const
Definition: Vector4.cpp:50
Vector3 zxz() const
Definition: Vector4.cpp:231
Vector2 yy() const
Definition: Vector4.cpp:183
Vector4 wxyz() const
Definition: Vector4.cpp:411
Vector4 ywwy() const
Definition: Vector4.cpp:389
Vector4 zxxy() const
Definition: Vector4.cpp:330
Vector3 yzy() const
Definition: Vector4.cpp:222
Vector4 wzxx() const
Definition: Vector4.cpp:275
Vector4 xwxw() const
Definition: Vector4.cpp:468
Vector4 zxzy() const
Definition: Vector4.cpp:362
Vector4 xzwx() const
Definition: Vector4.cpp:320
Vector4 xxzy() const
Definition: Vector4.cpp:360
bool isZero() const
Definition: Vector4.h:674
Vector4 yyyw() const
Definition: Vector4.cpp:477
Vector3 zzy() const
Definition: Vector4.cpp:223
Vector4 zzyz() const
Definition: Vector4.cpp:418
Definition: Vector4int8.h:30
Vector2 yx() const
Definition: Vector4.cpp:179
static const Vector4 & nan()
Definition: Vector4.cpp:72
Definition: HashTrait.h:105
Vector4 wwwx() const
Definition: Vector4.cpp:327
Vector4 wyyw() const
Definition: Vector4.cpp:479
Vector4 xxyy() const
Definition: Vector4.cpp:344
bool operator==(const Vector4 &rkVector) const
Definition: Vector4.h:594
Vector4 xxzx() const
Definition: Vector4.cpp:296
Definition: PositionTrait.h:5
Vector4 zzyy() const
Definition: Vector4.cpp:354
Definition: AABox.h:25
Vector4 yyyy() const
Definition: Vector4.cpp:349
Vector4 zywx() const
Definition: Vector4.cpp:318
bool any(float x)
Definition: g3dmath.h:424
Vector4 operator*(const Vector4 &rkVector) const
Definition: Vector4.h:140
Vector3 zzx() const
Definition: Vector4.cpp:207
Vector4 yzxz() const
Definition: Vector4.cpp:401
Vector4 xwxy() const
Definition: Vector4.cpp:340
Vector4 zwyy() const
Definition: Vector4.cpp:358
Vector4 xzyx() const
Definition: Vector4.cpp:288
Vector3 zwy() const
Definition: Vector4.cpp:227
Vector3 wxx() const
Definition: Vector4.cpp:200
float sum() const
Definition: Vector4.h:123
Vector4 wywy() const
Definition: Vector4.cpp:383
Vector4 xzxw() const
Definition: Vector4.cpp:464
Vector4 yxwz() const
Definition: Vector4.cpp:441
Vector3 wyy() const
Definition: Vector4.cpp:220
Vector4 ywww() const
Definition: Vector4.cpp:517
Vector4 yzyy() const
Definition: Vector4.cpp:353
Vector3 xyw() const
Definition: Vector4.cpp:249
void deserialize(std::string &s, BinaryInput &b)
Definition: serialize.h:16
Vector3 yxz() const
Definition: Vector4.cpp:230
Vector4 wxxw() const
Definition: Vector4.cpp:459
Vector4 zyxw() const
Definition: Vector4.cpp:462
Vector3 yyz() const
Definition: Vector4.cpp:234
Vector4 wxzy() const
Definition: Vector4.cpp:363
Vector4 ywxz() const
Definition: Vector4.cpp:405
Vector4 zwxw() const
Definition: Vector4.cpp:470
Vector3 wxz() const
Definition: Vector4.cpp:232
Vector3 yyy() const
Definition: Vector4.cpp:218
Vector3 yxy() const
Definition: Vector4.cpp:214
Vector4 yyxx() const
Definition: Vector4.cpp:269
double clamp(double val, double low, double hi)
Definition: g3dmath.h:571
Vector4 yxxy() const
Definition: Vector4.cpp:329
Definition: Vector4.h:538
Vector4 zzyx() const
Definition: Vector4.cpp:290
Vector4 wzww() const
Definition: Vector4.cpp:515
float & operator[](int i)
Definition: Vector4.h:575
Vector3 wzw() const
Definition: Vector4.cpp:256
Vector4 yxwy() const
Definition: Vector4.cpp:377
Vector4 zyyx() const
Definition: Vector4.cpp:286
Vector4 xzyz() const
Definition: Vector4.cpp:416
Vector4 yzwy() const
Definition: Vector4.cpp:385
Vector3 yzw() const
Definition: Vector4.cpp:254
Vector3 yxw() const
Definition: Vector4.cpp:246
Vector4 wwzz() const
Definition: Vector4.cpp:439
Vector4 zxxz() const
Definition: Vector4.cpp:394
Vector2 zz() const
Definition: Vector4.cpp:188
float y
Definition: Vector3.h:62
Vector4 ywzz() const
Definition: Vector4.cpp:437
bool operator<=(const Vector4 &) const
float x
Definition: Vector4.h:74
Vector4 yzzy() const
Definition: Vector4.cpp:369
Vector3 xyz() const
Definition: Vector4.cpp:233
Vector3 zyw() const
Definition: Vector4.cpp:251
T max(const T &x, const T &y)
Definition: g3dmath.h:320
Vector4 wzwx() const
Definition: Vector4.cpp:323
Vector3 wwx() const
Definition: Vector4.cpp:212
Vector3 www() const
Definition: Vector4.cpp:260
Definition: Vector3.h:58
Vector4 zwxz() const
Definition: Vector4.cpp:406
Vector4 wzwy() const
Definition: Vector4.cpp:387
Vector4 wwwy() const
Definition: Vector4.cpp:391
Vector4 & operator*=(float fScalar)
Definition: Vector4.h:649
Vector4 xyxw() const
Definition: Vector4.cpp:460
Vector4 zwxx() const
Definition: Vector4.cpp:278
Vector4 wwzy() const
Definition: Vector4.cpp:375
Vector3 yzx() const
Definition: Vector4.cpp:206
Vector4 zzww() const
Definition: Vector4.cpp:514
Vector4 wyzw() const
Definition: Vector4.cpp:495
Vector4 yyxw() const
Definition: Vector4.cpp:461
Vector4 wwxw() const
Definition: Vector4.cpp:471
Vector4 yxxx() const
Definition: Vector4.cpp:265
Vector4 zyxy() const
Definition: Vector4.cpp:334
float y
Definition: Vector2.h:50
Vector3 zxy() const
Definition: Vector4.cpp:215
void serialize(class BinaryOutput &b) const
Definition: Vector4.cpp:119
Vector4 wxwz() const
Definition: Vector4.cpp:443
void set(const Vector2 &v, float _z, float _w)
Definition: Vector4.h:105
Vector3 wxw() const
Definition: Vector4.cpp:248
Vector4 wxyw() const
Definition: Vector4.cpp:475
Vector3 yww() const
Definition: Vector4.cpp:258
Vector4 zwyx() const
Definition: Vector4.cpp:294
Vector4 yxzw() const
Definition: Vector4.cpp:489
Vector4 zzwy() const
Definition: Vector4.cpp:386
Vector4 zxxw() const
Definition: Vector4.cpp:458
Vector4 zyww() const
Definition: Vector4.cpp:510
Vector4 zwyz() const
Definition: Vector4.cpp:422
Vector4 xzwz() const
Definition: Vector4.cpp:448
Definition: Matrix4.h:36
Vector4 zwwx() const
Definition: Vector4.cpp:326
Vector4 zyyz() const
Definition: Vector4.cpp:414
Vector4 ywzw() const
Definition: Vector4.cpp:501
T min(const T &x, const T &y)
Definition: g3dmath.h:305
Easy loading and saving of human-readable configuration files.
Definition: Any.h:184
Vector4 zxwz() const
Definition: Vector4.cpp:442
Vector4 wwwz() const
Definition: Vector4.cpp:455
Vector3 zwx() const
Definition: Vector4.cpp:211
Vector3 zzw() const
Definition: Vector4.cpp:255
void set(float _x, float _y, float _z, float _w)
Definition: Vector4.h:91
Vector3 xyy() const
Definition: Vector4.cpp:217
Vector4 wzzz() const
Definition: Vector4.cpp:435
Vector4 yxyz() const
Definition: Vector4.cpp:409
Vector4 xxyz() const
Definition: Vector4.cpp:408
Vector4 wxxz() const
Definition: Vector4.cpp:395
Vector3 yxx() const
Definition: Vector4.cpp:198
Vector3 ywz() const
Definition: Vector4.cpp:242
Vector4 & operator=(const Any &a)
Definition: Vector4.cpp:24
Vector4 yyyx() const
Definition: Vector4.cpp:285
void serialize(const std::string &s, BinaryOutput &b)
Definition: serialize.h:12
Vector4 yxxw() const
Definition: Vector4.cpp:457
Vector4 wxzz() const
Definition: Vector4.cpp:427
Vector4 max(const Vector4 &v) const
Definition: Vector4.h:669
Vector4 yywx() const
Definition: Vector4.cpp:317
Vector4 wwyw() const
Definition: Vector4.cpp:487
Vector4 xxyw() const
Definition: Vector4.cpp:472
Vector4 xxxz() const
Definition: Vector4.cpp:392
Vector2 yz() const
Definition: Vector4.cpp:187
Vector2 zx() const
Definition: Vector4.cpp:180
Vector4 yxzx() const
Definition: Vector4.cpp:297
Vector4 yxxz() const
Definition: Vector4.cpp:393
Vector4 zxyx() const
Definition: Vector4.cpp:282
Vector3 wyz() const
Definition: Vector4.cpp:236
Vector3 wyw() const
Definition: Vector4.cpp:252
Vector4 xwyz() const
Definition: Vector4.cpp:420
Vector4 yyxz() const
Definition: Vector4.cpp:397
float squaredLength() const
Definition: Vector4.h:698
Vector4 zzwz() const
Definition: Vector4.cpp:450
Vector2 yw() const
Definition: Vector4.cpp:191
Vector4 xwwx() const
Definition: Vector4.cpp:324
Vector3 xyx() const
Definition: Vector4.cpp:201
bool operator<(const Vector4 &) const
Vector4 clamp(float low, float high) const
Definition: Vector4.h:169
Vector4 xxxw() const
Definition: Vector4.cpp:456
Vector3 ywy() const
Definition: Vector4.cpp:226
Vector4 wxyx() const
Definition: Vector4.cpp:283
Vector4 xwxz() const
Definition: Vector4.cpp:404
Vector4 xwwy() const
Definition: Vector4.cpp:388
Vector4 wxwy() const
Definition: Vector4.cpp:379
Vector4 zxwy() const
Definition: Vector4.cpp:378
Vector2 xw() const
Definition: Vector4.cpp:190
Vector4 xywy() const
Definition: Vector4.cpp:380
Vector4 wyyy() const
Definition: Vector4.cpp:351
Vector4 clamp(const Vector4 &low, const Vector4 &high) const
Definition: Vector4.h:161
Vector3 zyz() const
Definition: Vector4.cpp:235
Vector4 xzxx() const
Definition: Vector4.cpp:272
Vector4 wyxy() const
Definition: Vector4.cpp:335
Vector4 wwzx() const
Definition: Vector4.cpp:311
Vector4 yzxw() const
Definition: Vector4.cpp:465
Vector4 zyzw() const
Definition: Vector4.cpp:494
Vector4 wxzw() const
Definition: Vector4.cpp:491
Vector4 xyzy() const
Definition: Vector4.cpp:364
Definition: Vector4.h:39
Vector4 zxwx() const
Definition: Vector4.cpp:314
Vector4 yxyx() const
Definition: Vector4.cpp:281
Vector4 yzyw() const
Definition: Vector4.cpp:481
float x
Definition: Vector2.h:49
Vector4 zxzw() const
Definition: Vector4.cpp:490
Vector4 yxyw() const
Definition: Vector4.cpp:473
bool fuzzyNe(const Vector4 &other) const
Vector4 yzwz() const
Definition: Vector4.cpp:449
Vector4 zyzz() const
Definition: Vector4.cpp:430
Vector4 xxwy() const
Definition: Vector4.cpp:376
Vector4 wxwx() const
Definition: Vector4.cpp:315
Vector4 zywy() const
Definition: Vector4.cpp:382
Vector4 wzwz() const
Definition: Vector4.cpp:451
Vector4 zxyz() const
Definition: Vector4.cpp:410
Vector4 yzxy() const
Definition: Vector4.cpp:337
Vector3 yyx() const
Definition: Vector4.cpp:202
Vector3 xxz() const
Definition: Vector4.cpp:229
Vector4 ywwz() const
Definition: Vector4.cpp:453
Vector3 zxw() const
Definition: Vector4.cpp:247
Vector4 zwzw() const
Definition: Vector4.cpp:502
Vector4 wywx() const
Definition: Vector4.cpp:319
Vector4 xzzw() const
Definition: Vector4.cpp:496
Vector4 & operator/=(float fScalar)
Definition: Vector4.cpp:156
Vector4 wzzw() const
Definition: Vector4.cpp:499
Vector4 & operator-=(const Vector4 &rkVector)
Definition: Vector4.h:633
Vector3 xzz() const
Definition: Vector4.cpp:237
Vector4 zzzy() const
Definition: Vector4.cpp:370
Vector3 wzy() const
Definition: Vector4.cpp:224
Vector4 wyzx() const
Definition: Vector4.cpp:303
float dot(const Vector4 &rkVector) const
Definition: Vector4.h:659
Vector4 xxxx() const
Definition: Vector4.cpp:264
Vector4 yywz() const
Definition: Vector4.cpp:445
Vector4 yxww() const
Definition: Vector4.cpp:505
Vector4 xxyx() const
Definition: Vector4.cpp:280
float z
Definition: Vector4.h:74
Vector3 xwz() const
Definition: Vector4.cpp:241
Vector4 wwxz() const
Definition: Vector4.cpp:407
Vector4 wzyy() const
Definition: Vector4.cpp:355
Vector3 wwz() const
Definition: Vector4.cpp:244
Vector4 ywyy() const
Definition: Vector4.cpp:357
Vector4 zwwy() const
Definition: Vector4.cpp:390
Vector4 xzyw() const
Definition: Vector4.cpp:480
Vector4 wyxz() const
Definition: Vector4.cpp:399
Vector4 yzzw() const
Definition: Vector4.cpp:497
Vector4 zyzx() const
Definition: Vector4.cpp:302
Vector4 xyzx() const
Definition: Vector4.cpp:300
Vector3 yyw() const
Definition: Vector4.cpp:250
Vector4 xxwz() const
Definition: Vector4.cpp:440
Vector4 wxxx() const
Definition: Vector4.cpp:267
Vector4 ywyw() const
Definition: Vector4.cpp:485
Vector4 zyyw() const
Definition: Vector4.cpp:478
Vector4 min(const Vector4 &v) const
Definition: Vector4.h:664
Vector4 xwyw() const
Definition: Vector4.cpp:484
Vector4 ywxx() const
Definition: Vector4.cpp:277
static void getPosition(const G3D::Vector4 &v, G3D::Vector3 &p)
Definition: Vector4.h:714
float z
Definition: Vector3.h:62
Vector4 xzxz() const
Definition: Vector4.cpp:400
Vector4 zwwz() const
Definition: Vector4.cpp:454
bool isUnit() const
Definition: Vector4.h:686
Vector4 zzxx() const
Definition: Vector4.cpp:274
Vector4 xwzz() const
Definition: Vector4.cpp:436
Vector2 ww() const
Definition: Vector4.cpp:193
std::string toString() const
Definition: Vector4.cpp:173
Vector4 xwzy() const
Definition: Vector4.cpp:372
Vector4 yywy() const
Definition: Vector4.cpp:381
Vector3 wwy() const
Definition: Vector4.cpp:228
Vector4 zzxw() const
Definition: Vector4.cpp:466
Vector3 xxw() const
Definition: Vector4.cpp:245
Vector4 wyxw() const
Definition: Vector4.cpp:463
Vector4 zzzz() const
Definition: Vector4.cpp:434
Vector4 yyzz() const
Definition: Vector4.cpp:429
Vector3 xzx() const
Definition: Vector4.cpp:205
Vector4 xwyx() const
Definition: Vector4.cpp:292
void deserialize(class BinaryInput &b)
Definition: Vector4.cpp:111
Vector4 wwyy() const
Definition: Vector4.cpp:359
Definition: BinaryOutput.h:52
Vector4 xwww() const
Definition: Vector4.cpp:516
Vector4 xxwx() const
Definition: Vector4.cpp:312
Vector4 xyyw() const
Definition: Vector4.cpp:476
Vector4 yyzx() const
Definition: Vector4.cpp:301
Vector3 zwz() const
Definition: Vector4.cpp:243
Vector4 yzww() const
Definition: Vector4.cpp:513
Vector4 operator+(const Vector4 &rkVector) const
Definition: Vector4.h:604
Vector4 yxyy() const
Definition: Vector4.cpp:345
Vector4 yxzy() const
Definition: Vector4.cpp:361
Vector4 wwyx() const
Definition: Vector4.cpp:295
Vector3 xww() const
Definition: Vector4.cpp:257
Vector4 wyyx() const
Definition: Vector4.cpp:287
Vector4 yzyx() const
Definition: Vector4.cpp:289
Vector3 xxy() const
Definition: Vector4.cpp:213
Vector4 xyyz() const
Definition: Vector4.cpp:412
Vector4 ywyx() const
Definition: Vector4.cpp:293
Vector4 zyzy() const
Definition: Vector4.cpp:366
Vector4 wxxy() const
Definition: Vector4.cpp:331
Vector4 yzxx() const
Definition: Vector4.cpp:273
Vector4 wxww() const
Definition: Vector4.cpp:507
Vector3 xzy() const
Definition: Vector4.cpp:221
Vector3 zxx() const
Definition: Vector4.cpp:199
float y
Definition: Vector4.h:74
static const Vector4 & inf()
Definition: Vector4.cpp:61
Vector4 zzxz() const
Definition: Vector4.cpp:402
bool operator>(const Vector4 &) const
Vector3 wzx() const
Definition: Vector4.cpp:208
Vector4 zxzx() const
Definition: Vector4.cpp:298
Vector4 yzyz() const
Definition: Vector4.cpp:417
Vector4 wzyw() const
Definition: Vector4.cpp:483
Vector3 wxy() const
Definition: Vector4.cpp:216
Vector4 & operator+=(const Vector4 &rkVector)
Definition: Vector4.h:624
Vector2 wz() const
Definition: Vector4.cpp:189
void set(const Vector3 &v, float _w)
Definition: Vector4.h:98
Vector4 wzyz() const
Definition: Vector4.cpp:419
bool operator>=(const Vector4 &) const
Vector4 zwzx() const
Definition: Vector4.cpp:310
Vector4 ywzy() const
Definition: Vector4.cpp:373
Vector4 xywx() const
Definition: Vector4.cpp:316
Vector4 ywzx() const
Definition: Vector4.cpp:309
Vector4 yyww() const
Definition: Vector4.cpp:509
Vector2 xy() const
Definition: Vector4.cpp:182
bool fuzzyEq(const Vector4 &other) const
Vector4 zyxx() const
Definition: Vector4.cpp:270
Vector4 wyxx() const
Definition: Vector4.cpp:271
Vector4 xyyy() const
Definition: Vector4.cpp:348
Vector4 xxww() const
Definition: Vector4.cpp:504
Vector4 zxyw() const
Definition: Vector4.cpp:474
Vector2 wx() const
Definition: Vector4.cpp:181
static const Vector4 & zero()
Definition: Vector4.cpp:67
Vector4 zzwx() const
Definition: Vector4.cpp:322
Vector4 yxzz() const
Definition: Vector4.cpp:425
Vector4 ywxw() const
Definition: Vector4.cpp:469
Vector4 wzxy() const
Definition: Vector4.cpp:339
Vector4 xyzw() const
Definition: Vector4.cpp:492
Vector4 wxzx() const
Definition: Vector4.cpp:299
Vector4 xzzx() const
Definition: Vector4.cpp:304
Vector4 zwyw() const
Definition: Vector4.cpp:486
Definition: Color4.h:33
Vector4 yyxy() const
Definition: Vector4.cpp:333
Vector2 xx() const
Definition: Vector4.cpp:178
Vector4 xwyy() const
Definition: Vector4.cpp:356
Vector3 xwx() const
Definition: Vector4.cpp:209
Vector4 xyxx() const
Definition: Vector4.cpp:268
Vector4 operator-() const
Definition: Vector4.h:619
Vector4 xwwz() const
Definition: Vector4.cpp:452
Vector4 wyyz() const
Definition: Vector4.cpp:415
Vector4 xxzw() const
Definition: Vector4.cpp:488
Vector4 zzzx() const
Definition: Vector4.cpp:306
bool isFinite(double x)
Definition: g3dmath.h:525
Vector3 xwy() const
Definition: Vector4.cpp:225
Vector4 xywz() const
Definition: Vector4.cpp:444
Vector4 wxyy() const
Definition: Vector4.cpp:347
Vector4 wwxy() const
Definition: Vector4.cpp:343
Vector4 zywz() const
Definition: Vector4.cpp:446
Vector4 xyyx() const
Definition: Vector4.cpp:284
Vector4 xxzz() const
Definition: Vector4.cpp:424
Vector4 xzww() const
Definition: Vector4.cpp:512
Vector4 lerp(const Vector4 &v, float alpha) const
Definition: Vector4.h:643
Vector3 wyx() const
Definition: Vector4.cpp:204
Vector4 yxwx() const
Definition: Vector4.cpp:313
Vector4 wzyx() const
Definition: Vector4.cpp:291
Vector4 xyww() const
Definition: Vector4.cpp:508
bool operator!=(const Vector4 &rkVector) const
Definition: Vector4.h:599
Vector4 zzxy() const
Definition: Vector4.cpp:338
Vector2 zw() const
Definition: Vector4.cpp:192
Vector4 zwww() const
Definition: Vector4.cpp:518
Vector3 xzw() const
Definition: Vector4.cpp:253
Vector4 xzzz() const
Definition: Vector4.cpp:432