Visualization Library 2.1.0

A lightweight C++ OpenGL middleware for 2D/3D graphics

VL     Star     Watch     Fork     Issue

[Download] [Tutorials] [All Classes] [Grouped Classes]
Vector4.hpp
Go to the documentation of this file.
1 /**************************************************************************************/
2 /* */
3 /* Visualization Library */
4 /* http://visualizationlibrary.org */
5 /* */
6 /* Copyright (c) 2005-2020, Michele Bosi */
7 /* All rights reserved. */
8 /* */
9 /* Redistribution and use in source and binary forms, with or without modification, */
10 /* are permitted provided that the following conditions are met: */
11 /* */
12 /* - Redistributions of source code must retain the above copyright notice, this */
13 /* list of conditions and the following disclaimer. */
14 /* */
15 /* - Redistributions in binary form must reproduce the above copyright notice, this */
16 /* list of conditions and the following disclaimer in the documentation and/or */
17 /* other materials provided with the distribution. */
18 /* */
19 /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND */
20 /* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED */
21 /* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE */
22 /* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR */
23 /* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES */
24 /* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; */
25 /* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON */
26 /* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */
27 /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS */
28 /* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
29 /* */
30 /**************************************************************************************/
31 
32 #ifndef Vector4_INCLUDE_ONCE
33 #define Vector4_INCLUDE_ONCE
34 
35 #include <vlCore/Vector3.hpp>
36 
37 namespace vl
38 {
43  template<typename T_Scalar>
44  class Vector4
45  {
46  public:
47  typedef T_Scalar scalar_type;
48  typedef T_Scalar* scalar_ptr_type;
49  static const int scalar_count = 4;
50  Vector4(const Vector4& other) { *this = other; }
51  Vector4() { x() = y() = z() = w() = 0; }
52 
53  template<class T>
54  explicit Vector4(const T& other)
55  {
56  x() = (T_Scalar)other.x();
57  y() = (T_Scalar)other.y();
58  z() = (T_Scalar)other.z();
59  w() = (T_Scalar)other.w();
60  }
61 
62  explicit Vector4(const scalar_ptr_type& pval)
63  {
64  mScalar[0] = pval[0];
65  mScalar[1] = pval[1];
66  mScalar[2] = pval[2];
67  mScalar[3] = pval[3];
68  }
69 
70  explicit Vector4(T_Scalar val)
71  {
72  mScalar[0] = mScalar[1] = mScalar[2] = mScalar[3] = val;
73  }
74 
75  explicit Vector4(T_Scalar x, T_Scalar y, T_Scalar z, T_Scalar w)
76  {
77  mScalar[0] = x;
78  mScalar[1] = y;
79  mScalar[2] = z;
80  mScalar[3] = w;
81  }
82 
83  explicit Vector4(const Vector3<T_Scalar>& v, T_Scalar w)
84  {
85  mScalar[0] = v.x();
86  mScalar[1] = v.y();
87  mScalar[2] = v.z();
88  mScalar[3] = w;
89  }
90 
91  explicit Vector4(const Vector2<T_Scalar>& u, const Vector2<T_Scalar>& v)
92  {
93  mScalar[0] = u.x();
94  mScalar[1] = u.y();
95  mScalar[2] = v.x();
96  mScalar[3] = v.y();
97  }
98 
99  T_Scalar* ptr() { return mScalar; }
100  const T_Scalar* ptr() const { return mScalar; }
101 
102  const T_Scalar& x() const { return mScalar[0]; }
103  const T_Scalar& y() const { return mScalar[1]; }
104  const T_Scalar& z() const { return mScalar[2]; }
105  const T_Scalar& w() const { return mScalar[3]; }
106 
107  T_Scalar& x() { return mScalar[0]; }
108  T_Scalar& y() { return mScalar[1]; }
109  T_Scalar& z() { return mScalar[2]; }
110  T_Scalar& w() { return mScalar[3]; }
111 
112  const T_Scalar& r() const { return mScalar[0]; }
113  const T_Scalar& g() const { return mScalar[1]; }
114  const T_Scalar& b() const { return mScalar[2]; }
115  const T_Scalar& a() const { return mScalar[3]; }
116 
117  T_Scalar& r() { return mScalar[0]; }
118  T_Scalar& g() { return mScalar[1]; }
119  T_Scalar& b() { return mScalar[2]; }
120  T_Scalar& a() { return mScalar[3]; }
121 
122  const T_Scalar& s() const { return mScalar[0]; }
123  const T_Scalar& t() const { return mScalar[1]; }
124  const T_Scalar& p() const { return mScalar[2]; }
125  const T_Scalar& q() const { return mScalar[3]; }
126 
127  T_Scalar& s() { return mScalar[0]; }
128  T_Scalar& t() { return mScalar[1]; }
129  T_Scalar& p() { return mScalar[2]; }
130  T_Scalar& q() { return mScalar[3]; }
131 
132  Vector3<T_Scalar> xyz() const { return Vector3<T_Scalar>(x(),y(),z()); }
133  Vector3<T_Scalar> rgb() const { return Vector3<T_Scalar>(x(),y(),z()); }
134  Vector3<T_Scalar> stp() const { return Vector3<T_Scalar>(x(),y(),z()); }
135 
136  Vector2<T_Scalar> xy() const { return Vector2<T_Scalar>(x(),y()); }
137  Vector2<T_Scalar> rg() const { return Vector2<T_Scalar>(x(),y()); }
138  Vector2<T_Scalar> st() const { return Vector2<T_Scalar>(x(),y()); }
139 
140  Vector4 operator+(const Vector4& other) const
141  {
142  return Vector4(x()+other.x(), y()+other.y(), z()+other.z(), w()+other.w());
143  }
144  Vector4 operator-(const Vector4& other) const
145  {
146  return Vector4(x()-other.x(), y()-other.y(), z()-other.z(), w()-other.w());
147  }
148  Vector4 operator*(const Vector4& other) const
149  {
150  return Vector4(x()*other.x(), y()*other.y(), z()*other.z(), w()*other.w());
151  }
152  Vector4 operator/(const Vector4& other) const
153  {
154  return Vector4(x()/other.x(), y()/other.y(), z()/other.z(), w()/other.w());
155  }
156  Vector4 operator+(T_Scalar val) const
157  {
158  return Vector4(x()+val, y()+val, z()+val, w()+val);
159  }
160  Vector4 operator-(T_Scalar val) const
161  {
162  return Vector4(x()-val, y()-val, z()-val, w()-val);
163  }
164  Vector4 operator*(T_Scalar val) const
165  {
166  return Vector4(x()*val, y()*val, z()*val, w()*val);
167  }
168  Vector4 operator/(T_Scalar val) const
169  {
170  return Vector4(x()/val, y()/val, z()/val, w()/val);
171  }
173  {
174  return Vector4(-x(), -y(), -z(), -w());
175  }
176  Vector4& operator+=(const Vector4& other)
177  {
178  *this = *this + other;
179  return *this;
180  }
181  Vector4& operator-=(const Vector4& other)
182  {
183  *this = *this - other;
184  return *this;
185  }
186  Vector4& operator*=(const Vector4& other)
187  {
188  *this = *this * other;
189  return *this;
190  }
191  Vector4& operator/=(const Vector4& other)
192  {
193  *this = *this / other;
194  return *this;
195  }
196  Vector4& operator+=(T_Scalar val)
197  {
198  *this = *this + val;
199  return *this;
200  }
201  Vector4& operator-=(T_Scalar val)
202  {
203  *this = *this - val;
204  return *this;
205  }
206  Vector4& operator*=(T_Scalar val)
207  {
208  *this = *this * val;
209  return *this;
210  }
211  Vector4& operator/=(T_Scalar val)
212  {
213  *this = *this / val;
214  return *this;
215  }
216  Vector4& operator=(const Vector4& other)
217  {
218  x() = other.x();
219  y() = other.y();
220  z() = other.z();
221  w() = other.w();
222  return *this;
223  }
224  Vector4& operator=(T_Scalar val)
225  {
226  x() = y() = z() = w() = val;
227  return *this;
228  }
229  bool operator==(const Vector4& other) const
230  {
231  return x() == other.x() && y() == other.y() && z() == other.z() && w() == other.w();
232  }
233  bool operator!=(const Vector4& other) const
234  {
235  return !operator==(other);
236  }
237  bool operator<(const Vector4& other) const
238  {
239  if (x() != other.x())
240  return x() < other.x();
241  else
242  if (y() != other.y())
243  return y() < other.y();
244  else
245  if (z() != other.z())
246  return z() < other.z();
247  else
248  return w() < other.w();
249  }
250  T_Scalar& operator[](unsigned i) { return mScalar[i]; }
251  const T_Scalar& operator[](unsigned i) const { return mScalar[i]; }
252  T_Scalar length() const { return (T_Scalar)::sqrt(x()*x()+y()*y()+z()*z()+w()*w()); }
253  T_Scalar lengthSquared() const { return x()*x()+y()*y()+z()*z()+w()*w(); }
254  bool isNull() const { return !x() && !y() && !z() && !w(); }
255  const Vector4& normalize(T_Scalar *len=NULL)
256  {
257  T_Scalar l = length();
258  if (len)
259  *len = l;
260  if (l)
261  *this *= (T_Scalar)(1.0/l);
262  return *this;
263  }
264 
265  protected:
267  };
268 
269  template<typename T>
270  inline const Vector4<T> operator*(T val, const Vector4<T>& v)
271  {
272  return v * val;
273  }
274 
291 
292  #if VL_PIPELINE_PRECISION == 2
293  typedef dvec4 vec4;
295  #else
296  typedef fvec4 vec4;
298  #endif
299 
300  inline float dot(const fvec4& v1, const fvec4& v2) { return v1.x()*v2.x() + v1.y()*v2.y() + v1.z()*v2.z() + v1.w()*v2.w(); }
301  inline double dot(const dvec4& v1, const dvec4& v2) { return v1.x()*v2.x() + v1.y()*v2.y() + v1.z()*v2.z() + v1.w()*v2.w(); }
302  inline float dot(const ivec4& v1, const ivec4& v2) { return (float)(v1.x()*v2.x() + v1.y()*v2.y() + v1.z()*v2.z() + v1.w()*v2.w()); }
303  inline float dot(const uvec4& v1, const uvec4& v2) { return (float)(v1.x()*v2.x() + v1.y()*v2.y() + v1.z()*v2.z() + v1.w()*v2.w()); }
304 
305  inline fvec4 min(const fvec4& a, const fvec4& b)
306  {
307  return fvec4( a.x() < b.x() ? a.x() : b.x(),
308  a.y() < b.y() ? a.y() : b.y(),
309  a.z() < b.z() ? a.z() : b.z(),
310  a.w() < b.w() ? a.w() : b.w() );
311  }
312  inline fvec4 min(const fvec4& a, float b)
313  {
314  return fvec4( a.x() < b ? a.x() : b,
315  a.y() < b ? a.y() : b,
316  a.z() < b ? a.z() : b,
317  a.w() < b ? a.w() : b );
318  }
319  inline dvec4 min(const dvec4& a, const dvec4& b)
320  {
321  return dvec4( a.x() < b.x() ? a.x() : b.x(),
322  a.y() < b.y() ? a.y() : b.y(),
323  a.z() < b.z() ? a.z() : b.z(),
324  a.w() < b.w() ? a.w() : b.w() );
325  }
326  inline dvec4 min(const dvec4& a, double b)
327  {
328  return dvec4( a.x() < b ? a.x() : b,
329  a.y() < b ? a.y() : b,
330  a.z() < b ? a.z() : b,
331  a.w() < b ? a.w() : b );
332  }
333  inline ivec4 min(const ivec4& a, const ivec4& b)
334  {
335  return ivec4( a.x() < b.x() ? a.x() : b.x(),
336  a.y() < b.y() ? a.y() : b.y(),
337  a.z() < b.z() ? a.z() : b.z(),
338  a.w() < b.w() ? a.w() : b.w() );
339  }
340  inline ivec4 min(const ivec4& a, int b)
341  {
342  return ivec4( a.x() < b ? a.x() : b,
343  a.y() < b ? a.y() : b,
344  a.z() < b ? a.z() : b,
345  a.w() < b ? a.w() : b );
346  }
347  inline uvec4 min(const uvec4& a, const uvec4& b)
348  {
349  return uvec4( a.x() < b.x() ? a.x() : b.x(),
350  a.y() < b.y() ? a.y() : b.y(),
351  a.z() < b.z() ? a.z() : b.z(),
352  a.w() < b.w() ? a.w() : b.w() );
353  }
354  inline uvec4 min(const uvec4& a, unsigned int b)
355  {
356  return uvec4( a.x() < b ? a.x() : b,
357  a.y() < b ? a.y() : b,
358  a.z() < b ? a.z() : b,
359  a.w() < b ? a.w() : b );
360  }
361  inline fvec4 max(const fvec4& a, const fvec4& b)
362  {
363  return fvec4( a.x() > b.x() ? a.x() : b.x(),
364  a.y() > b.y() ? a.y() : b.y(),
365  a.z() > b.z() ? a.z() : b.z(),
366  a.w() > b.w() ? a.w() : b.w() );
367  }
368  inline fvec4 max(const fvec4& a, float b)
369  {
370  return fvec4( a.x() > b ? a.x() : b,
371  a.y() > b ? a.y() : b,
372  a.z() > b ? a.z() : b,
373  a.w() > b ? a.w() : b );
374  }
375  inline dvec4 max(const dvec4& a, const dvec4& b)
376  {
377  return dvec4( a.x() > b.x() ? a.x() : b.x(),
378  a.y() > b.y() ? a.y() : b.y(),
379  a.z() > b.z() ? a.z() : b.z(),
380  a.w() > b.w() ? a.w() : b.w() );
381  }
382  inline dvec4 max(const dvec4& a, double b)
383  {
384  return dvec4( a.x() > b ? a.x() : b,
385  a.y() > b ? a.y() : b,
386  a.z() > b ? a.z() : b,
387  a.w() > b ? a.w() : b );
388  }
389  inline ivec4 max(const ivec4& a, const ivec4& b)
390  {
391  return ivec4( a.x() > b.x() ? a.x() : b.x(),
392  a.y() > b.y() ? a.y() : b.y(),
393  a.z() > b.z() ? a.z() : b.z(),
394  a.w() > b.w() ? a.w() : b.w() );
395  }
396  inline ivec4 max(const ivec4& a, int b)
397  {
398  return ivec4( a.x() > b ? a.x() : b,
399  a.y() > b ? a.y() : b,
400  a.z() > b ? a.z() : b,
401  a.w() > b ? a.w() : b );
402  }
403  inline uvec4 max(const uvec4& a, const uvec4& b)
404  {
405  return uvec4( a.x() > b.x() ? a.x() : b.x(),
406  a.y() > b.y() ? a.y() : b.y(),
407  a.z() > b.z() ? a.z() : b.z(),
408  a.w() > b.w() ? a.w() : b.w() );
409  }
410  inline uvec4 max(const uvec4& a, unsigned int b)
411  {
412  return uvec4( a.x() > b ? a.x() : b,
413  a.y() > b ? a.y() : b,
414  a.z() > b ? a.z() : b,
415  a.w() > b ? a.w() : b );
416  }
417  inline fvec4 clamp(const fvec4& x, float minval, float maxval) { return min(max(x,minval),maxval); }
418  inline fvec4 clamp(const fvec4& x, const fvec4& minval, const fvec4& maxval) { return min(max(x,minval),maxval); }
419  inline dvec4 clamp(const dvec4& x, double minval, double maxval) { return min(max(x,minval),maxval); }
420  inline dvec4 clamp(const dvec4& x, const dvec4& minval, const dvec4& maxval) { return min(max(x,minval),maxval); }
421  inline ivec4 clamp(const ivec4& x, int minval, int maxval) { return min(max(x,minval),maxval); }
422  inline ivec4 clamp(const ivec4& x, const ivec4& minval, const ivec4& maxval) { return min(max(x,minval),maxval); }
423  inline uvec4 clamp(const uvec4& x, unsigned int minval, unsigned int maxval) { return min(max(x,minval),maxval); }
424  inline uvec4 clamp(const uvec4& x, const uvec4& minval, const uvec4& maxval) { return min(max(x,minval),maxval); }
425 }
426 
427 #endif
Vector4 & operator/=(T_Scalar val)
Definition: Vector4.hpp:211
const T_Scalar & z() const
Definition: Vector4.hpp:104
Vector4(T_Scalar x, T_Scalar y, T_Scalar z, T_Scalar w)
Definition: Vector4.hpp:75
float clamp(float x, float minval, float maxval)
Definition: Vector2.hpp:316
T_Scalar & g()
Definition: Vector4.hpp:118
Vector2< T_Scalar > xy() const
Definition: Vector4.hpp:136
T_Scalar & operator[](unsigned i)
Definition: Vector4.hpp:250
const T_Scalar & x() const
Definition: Vector4.hpp:102
T sqrt(T a)
Definition: glsl_math.hpp:592
T_Scalar & a()
Definition: Vector4.hpp:120
Vector4< float > fvec4
A 4 components vector with float precision.
Definition: Vector4.hpp:280
const T_Scalar & s() const
Definition: Vector4.hpp:122
Vector4< unsigned char > ubvec4
A 4 components vector with unsigned char precision.
Definition: Vector4.hpp:286
T_Scalar & x()
Definition: Vector4.hpp:107
const T_Scalar & z() const
Definition: Vector3.hpp:92
const T_Scalar & r() const
Definition: Vector4.hpp:112
T_Scalar * scalar_ptr_type
Definition: Vector4.hpp:48
Vector4(const Vector4 &other)
Definition: Vector4.hpp:50
T_Scalar length() const
Definition: Vector4.hpp:252
Vector4 operator-(T_Scalar val) const
Definition: Vector4.hpp:160
Vector4 operator-(const Vector4 &other) const
Definition: Vector4.hpp:144
Vector3< T_Scalar > stp() const
Definition: Vector4.hpp:134
Vector4 & operator/=(const Vector4 &other)
Definition: Vector4.hpp:191
Vector3< T_Scalar > xyz() const
Definition: Vector4.hpp:132
Vector4< unsigned int > uvec4
A 4 components vector with unsigned int precision.
Definition: Vector4.hpp:278
The Vector4 class is a template class that implements a generic 4 components vector, see also vl::fvec4, vl::dvec4, vl::uvec4, vl::ivec4, vl::svec4, vl::usvec4, vl::bvec4, vl::ubvec4.
Definition: Vector4.hpp:44
T_Scalar lengthSquared() const
Definition: Vector4.hpp:253
T_Scalar & y()
Definition: Vector4.hpp:108
Vector4 & operator+=(const Vector4 &other)
Definition: Vector4.hpp:176
T_Scalar & s()
Definition: Vector4.hpp:127
Visualization Library main namespace.
Vector4(const Vector3< T_Scalar > &v, T_Scalar w)
Definition: Vector4.hpp:83
float dot(float a, float b)
Definition: glsl_math.hpp:1111
Vector4 operator*(T_Scalar val) const
Definition: Vector4.hpp:164
Vector4(const Vector2< T_Scalar > &u, const Vector2< T_Scalar > &v)
Definition: Vector4.hpp:91
static const int scalar_count
Definition: Vector4.hpp:49
Vector4 & operator-=(T_Scalar val)
Definition: Vector4.hpp:201
Vector2< T_Scalar > st() const
Definition: Vector4.hpp:138
const T_Scalar & p() const
Definition: Vector4.hpp:124
const T_Scalar & g() const
Definition: Vector4.hpp:113
const T_Scalar * ptr() const
Definition: Vector4.hpp:100
Vector4 & operator-=(const Vector4 &other)
Definition: Vector4.hpp:181
The Vector3 class is a template class that implements a generic 3 components vector, see also vl::fvec3, vl::dvec3, vl::uvec3, vl::ivec3, vl::svec3, vl::usvec3, vl::bvec3, vl::ubvec3.
Definition: Vector3.hpp:44
Vector4 operator/(const Vector4 &other) const
Definition: Vector4.hpp:152
Vector4(const scalar_ptr_type &pval)
Definition: Vector4.hpp:62
Vector4< int > ivec4
A 4 components vector with int precision.
Definition: Vector4.hpp:276
const T_Scalar & operator[](unsigned i) const
Definition: Vector4.hpp:251
float max(float a, float b)
Definition: Vector2.hpp:312
Vector4 & operator*=(T_Scalar val)
Definition: Vector4.hpp:206
float min(float a, float b)
Definition: Vector2.hpp:308
Vector4(T_Scalar val)
Definition: Vector4.hpp:70
bool operator==(const Vector4 &other) const
Definition: Vector4.hpp:229
Vector4< short > svec4
A 4 components vector with short precision.
Definition: Vector4.hpp:288
Vector2< T_Scalar > rg() const
Definition: Vector4.hpp:137
bool operator!=(const Vector4 &other) const
Definition: Vector4.hpp:233
const T_Scalar & y() const
Definition: Vector3.hpp:91
const T_Scalar & y() const
Definition: Vector4.hpp:103
Vector4< double > dvec4
A 4 components vector with double precision.
Definition: Vector4.hpp:282
Vector4 operator+(const Vector4 &other) const
Definition: Vector4.hpp:140
T_Scalar & q()
Definition: Vector4.hpp:130
T_Scalar & r()
Definition: Vector4.hpp:117
const T_Scalar & b() const
Definition: Vector4.hpp:114
#define NULL
Definition: OpenGLDefs.hpp:81
Vector4 operator-() const
Definition: Vector4.hpp:172
T_Scalar & z()
Definition: Vector4.hpp:109
Vector4 & operator*=(const Vector4 &other)
Definition: Vector4.hpp:186
Vector4 & operator=(const Vector4 &other)
Definition: Vector4.hpp:216
bool isNull() const
Definition: Vector4.hpp:254
The Vector2 class is a template class that implements a generic 2 components vector, see also vl::fvec2, vl::dvec2, vl::uvec2, vl::ivec2, vl::svec2, vl::usvec2, vl::bvec2, vl::ubvec2.
Definition: Vector2.hpp:97
T_Scalar scalar_type
Definition: Vector4.hpp:47
bool operator<(const Vector4 &other) const
Definition: Vector4.hpp:237
Vector4< char > bvec4
A 4 components vector with char precision.
Definition: Vector4.hpp:284
T_Scalar * ptr()
Definition: Vector4.hpp:99
Vector4 operator+(T_Scalar val) const
Definition: Vector4.hpp:156
const Vector4 & normalize(T_Scalar *len=NULL)
Definition: Vector4.hpp:255
Vector4 operator/(T_Scalar val) const
Definition: Vector4.hpp:168
const T_Scalar & t() const
Definition: Vector4.hpp:123
Vector4< unsigned short > usvec4
A 4 components vector with unsigned short precision.
Definition: Vector4.hpp:290
T_Scalar & p()
Definition: Vector4.hpp:129
Vector4 & operator+=(T_Scalar val)
Definition: Vector4.hpp:196
const T_Scalar & x() const
Definition: Vector3.hpp:90
T_Scalar & t()
Definition: Vector4.hpp:128
Vector4 operator*(const Vector4 &other) const
Definition: Vector4.hpp:148
Vector4 & operator=(T_Scalar val)
Definition: Vector4.hpp:224
const T_Scalar & x() const
Definition: Vector2.hpp:133
Vector3< T_Scalar > rgb() const
Definition: Vector4.hpp:133
T_Scalar & w()
Definition: Vector4.hpp:110
fvec4 vec4
Defined as: &#39;typedef fvec4 vec4&#39;. See also VL_PIPELINE_PRECISION.
Definition: Vector4.hpp:297
const T_Scalar & y() const
Definition: Vector2.hpp:134
const T_Scalar & q() const
Definition: Vector4.hpp:125
T_Scalar & b()
Definition: Vector4.hpp:119
Vector4(const T &other)
Definition: Vector4.hpp:54
T_Scalar mScalar[scalar_count]
Definition: Vector4.hpp:266
const T_Scalar & w() const
Definition: Vector4.hpp:105
const T_Scalar & a() const
Definition: Vector4.hpp:115