34 Vec4i() { _v[0]=0; _v[1]=0; _v[2]=0; _v[3]=0; }
36 Vec4i(value_type
x, value_type
y, value_type
z, value_type
w)
44 inline bool operator == (
const Vec4i& v)
const {
return _v[0]==v.
_v[0] && _v[1]==v.
_v[1] && _v[2]==v.
_v[2] && _v[3]==v.
_v[3]; }
45 inline bool operator != (
const Vec4i& v)
const {
return _v[0]!=v.
_v[0] || _v[1]!=v.
_v[1] || _v[2]!=v.
_v[2] || _v[3]!=v.
_v[3]; }
48 if (_v[0]<v.
_v[0])
return true;
49 else if (_v[0]>v.
_v[0])
return false;
50 else if (_v[1]<v.
_v[1])
return true;
51 else if (_v[1]>v.
_v[1])
return false;
52 else if (_v[2]<v.
_v[2])
return true;
53 else if (_v[2]>v.
_v[2])
return false;
54 else return (_v[3]<v.
_v[3]);
57 inline value_type*
ptr() {
return _v; }
58 inline const value_type*
ptr()
const {
return _v; }
60 inline void set( value_type
x, value_type
y, value_type
z, value_type
w)
62 _v[0]=
x; _v[1]=
y; _v[2]=
z; _v[3]=
w;
65 inline value_type&
operator [] (
unsigned int i) {
return _v[i]; }
66 inline value_type
operator [] (
unsigned int i)
const {
return _v[i]; }
68 inline value_type&
x() {
return _v[0]; }
69 inline value_type&
y() {
return _v[1]; }
70 inline value_type&
z() {
return _v[2]; }
71 inline value_type&
w() {
return _v[3]; }
73 inline value_type
x()
const {
return _v[0]; }
74 inline value_type
y()
const {
return _v[1]; }
75 inline value_type
z()
const {
return _v[2]; }
76 inline value_type
w()
const {
return _v[3]; }
78 inline value_type&
r() {
return _v[0]; }
79 inline value_type&
g() {
return _v[1]; }
80 inline value_type&
b() {
return _v[2]; }
81 inline value_type&
a() {
return _v[3]; }
83 inline value_type
r()
const {
return _v[0]; }
84 inline value_type
g()
const {
return _v[1]; }
85 inline value_type
b()
const {
return _v[2]; }
86 inline value_type
a()
const {
return _v[3]; }
90 return Vec4i(_v[0]*rhs, _v[1]*rhs, _v[2]*rhs, _v[3]*rhs);
95 return Vec4i(_v[0]/rhs, _v[1]/rhs, _v[2]/rhs, _v[3]/rhs);
100 return Vec4i(_v[0]+rhs, _v[1]+rhs, _v[2]+rhs, _v[3]+rhs);
105 return Vec4i(_v[0]-rhs, _v[1]-rhs, _v[2]-rhs, _v[3]-rhs);
110 return Vec4i(_v[0]+rhs.
_v[0], _v[1]+rhs.
_v[1], _v[2]+rhs.
_v[2], _v[3]+rhs.
_v[3]);
115 return Vec4i(_v[0]-rhs.
_v[0], _v[1]-rhs.
_v[1], _v[2]-rhs.
_v[2], _v[3]-rhs.
_v[3]);
120 return Vec4i(_v[0]*rhs.
_v[0], _v[1]*rhs.
_v[1], _v[2]*rhs.
_v[2], _v[3]*rhs.
_v[3]);
Vec4i operator*(value_type rhs) const
value_type & operator[](unsigned int i)
void set(value_type x, value_type y, value_type z, value_type w)
Vec4i operator+(value_type rhs) const
bool operator<(const Vec4i &v) const
bool operator==(const Vec4i &v) const
Vec4i operator/(value_type rhs) const
bool operator!=(const Vec4i &v) const
Vec4i operator-(value_type rhs) const
Vec4i(value_type x, value_type y, value_type z, value_type w)
const value_type * ptr() const