32 Vec3us() { _v[0]=0; _v[1]=0; _v[2]=0; }
34 Vec3us(value_type
r, value_type
g, value_type
b) { _v[0]=
r; _v[1]=
g; _v[2]=
b; }
40 if (_v[0]<v.
_v[0])
return true;
41 else if (_v[0]>v.
_v[0])
return false;
42 else if (_v[1]<v.
_v[1])
return true;
43 else if (_v[1]>v.
_v[1])
return false;
44 else return (_v[2]<v.
_v[2]);
47 inline value_type*
ptr() {
return _v; }
48 inline const value_type*
ptr()
const {
return _v; }
50 inline void set(value_type
r, value_type
g, value_type
b)
52 _v[0]=
r; _v[1]=
g; _v[2]=
b;
57 _v[0]=rhs.
_v[0]; _v[1]=rhs.
_v[1]; _v[2]=rhs.
_v[2];
60 inline value_type&
operator [] (
unsigned int i) {
return _v[i]; }
61 inline value_type
operator [] (
unsigned int i)
const {
return _v[i]; }
63 inline value_type&
x() {
return _v[0]; }
64 inline value_type&
y() {
return _v[1]; }
65 inline value_type&
z() {
return _v[2]; }
67 inline value_type
x()
const {
return _v[0]; }
68 inline value_type
y()
const {
return _v[1]; }
69 inline value_type
z()
const {
return _v[2]; }
71 inline value_type&
r() {
return _v[0]; }
72 inline value_type&
g() {
return _v[1]; }
73 inline value_type&
b() {
return _v[2]; }
75 inline value_type
r()
const {
return _v[0]; }
76 inline value_type
g()
const {
return _v[1]; }
77 inline value_type
b()
const {
return _v[2]; }
82 return Vec3us(_v[0]*rhs, _v[1]*rhs, _v[2]*rhs);
97 return Vec3us(_v[0]/rhs, _v[1]/rhs, _v[2]/rhs);
112 return Vec3us(_v[0]*rhs.
_v[0], _v[1]*rhs.
_v[1], _v[2]*rhs.
_v[2]);
118 return Vec3us(_v[0]+rhs.
_v[0], _v[1]+rhs.
_v[1], _v[2]+rhs.
_v[2]);
135 return Vec3us(_v[0]-rhs.
_v[0], _v[1]-rhs.
_v[1], _v[2]-rhs.
_v[2]);
152 return Vec3us(lhs[0]*rhs[0], lhs[1]*rhs[1], lhs[2]*rhs[2]);
158 return Vec3us(lhs[0]/rhs[0], lhs[1]/rhs[1], lhs[2]/rhs[2]);
bool operator==(const Vec3us &v) const
value_type & operator[](unsigned int i)
Vec3us operator/(value_type rhs) const
const value_type * ptr() const
void set(const Vec3us &rhs)
Vec2d componentDivide(const Vec2d &lhs, const Vec2d &rhs)
Vec3us operator*(value_type rhs) const
void set(value_type r, value_type g, value_type b)
Vec3us & operator/=(value_type rhs)
Vec3us operator+(const Vec3us &rhs) const
Vec3us & operator-=(const Vec3us &rhs)
Vec3us(value_type r, value_type g, value_type b)
Vec3us & operator*=(value_type rhs)
unsigned short value_type
bool operator<(const Vec3us &v) const
Vec3us & operator+=(const Vec3us &rhs)
bool operator!=(const Vec3us &v) const
Vec3us operator-(const Vec3us &rhs) const
Vec2d componentMultiply(const Vec2d &lhs, const Vec2d &rhs)