34 Vec2s(value_type
x, value_type
y) { _v[0] =
x; _v[1] =
y; }
40 if (_v[0]<v.
_v[0])
return true;
41 else if (_v[0]>v.
_v[0])
return false;
42 else return (_v[1]<v.
_v[1]);
45 inline value_type*
ptr() {
return _v; }
46 inline const value_type*
ptr()
const {
return _v; }
48 inline void set( value_type
x, value_type
y)
55 _v[0]=rhs.
_v[0]; _v[1]=rhs.
_v[1];
61 inline value_type&
x() {
return _v[0]; }
62 inline value_type&
y() {
return _v[1]; }
64 inline value_type
x()
const {
return _v[0]; }
65 inline value_type
y()
const {
return _v[1]; }
67 inline value_type&
r() {
return _v[0]; }
68 inline value_type&
g() {
return _v[1]; }
70 inline value_type
r()
const {
return _v[0]; }
71 inline value_type
g()
const {
return _v[1]; }
75 return Vec2s(_v[0]*rhs, _v[1]*rhs);
87 return Vec2s(_v[0]/rhs, _v[1]/rhs);
99 return Vec2s(_v[0]*rhs.
_v[0], _v[1]*rhs.
_v[1]);
104 return Vec2s(_v[0]+rhs.
_v[0], _v[1]+rhs.
_v[1]);
116 return Vec2s(_v[0]-rhs.
_v[0], _v[1]-rhs.
_v[1]);
129 return Vec2s (-_v[0], -_v[1]);
139 return Vec2s(lhs[0]*rhs[0], lhs[1]*rhs[1]);
145 return Vec2s(lhs[0]/rhs[0], lhs[1]/rhs[1]);
Vec2s & operator+=(const Vec2s &rhs)
Vec2d componentDivide(const Vec2d &lhs, const Vec2d &rhs)
Vec2s operator*(value_type rhs) const
value_type & operator[](int i)
Vec2s & operator/=(value_type rhs)
const value_type * ptr() const
bool operator==(const Vec2s &v) const
bool operator!=(const Vec2s &v) const
void set(const Vec2s &rhs)
Vec2s operator+(const Vec2s &rhs) const
Vec2s & operator-=(const Vec2s &rhs)
Vec2s operator/(value_type rhs) const
Vec2s(value_type x, value_type y)
Vec2s & operator*=(value_type rhs)
void set(value_type x, value_type y)
bool operator<(const Vec2s &v) const
Vec2d componentMultiply(const Vec2d &lhs, const Vec2d &rhs)