44 Vec2f(value_type
x,value_type
y) { _v[0]=
x; _v[1]=
y; }
53 if (_v[0]<v.
_v[0])
return true;
54 else if (_v[0]>v.
_v[0])
return false;
55 else return (_v[1]<v.
_v[1]);
58 inline value_type *
ptr() {
return _v; }
59 inline const value_type *
ptr()
const {
return _v; }
61 inline void set( value_type
x, value_type
y ) { _v[0]=
x; _v[1]=
y; }
62 inline void set(
const Vec2f& rhs) { _v[0]=rhs.
_v[0]; _v[1]=rhs.
_v[1]; }
67 inline value_type &
x() {
return _v[0]; }
68 inline value_type &
y() {
return _v[1]; }
70 inline value_type
x()
const {
return _v[0]; }
71 inline value_type
y()
const {
return _v[1]; }
81 return _v[0]*rhs.
_v[0]+_v[1]*rhs.
_v[1];
87 return Vec2f(_v[0]*rhs, _v[1]*rhs);
101 return Vec2f(_v[0]/rhs, _v[1]/rhs);
115 return Vec2f(_v[0]+rhs.
_v[0], _v[1]+rhs.
_v[1]);
131 return Vec2f(_v[0]-rhs.
_v[0], _v[1]-rhs.
_v[1]);
145 return Vec2f (-_v[0], -_v[1]);
151 return sqrtf( _v[0]*_v[0] + _v[1]*_v[1] );
157 return _v[0]*_v[0] + _v[1]*_v[1];
168 value_type inv = 1.0f/norm;
180 return Vec2f(lhs[0]*rhs[0], lhs[1]*rhs[1]);
186 return Vec2f(lhs[0]/rhs[0], lhs[1]/rhs[1]);
value_type operator*(const Vec2f &rhs) const
Vec2f & operator*=(value_type rhs)
Vec2f & operator/=(value_type rhs)
value_type length2(void) const
bool operator<(const Vec2f &v) const
Vec2f & operator+=(const Vec2f &rhs)
Vec2d componentDivide(const Vec2d &lhs, const Vec2d &rhs)
bool operator==(const Vec2f &v) const
value_type & operator[](int i)
void set(const Vec2f &rhs)
const Vec2f operator/(value_type rhs) const
Vec2f & operator-=(const Vec2f &rhs)
bool operator!=(const Vec2f &v) const
void set(value_type x, value_type y)
value_type length() const
const Vec2f operator+(const Vec2f &rhs) const
Vec2f(value_type x, value_type y)
const value_type * ptr() const
Vec2d componentMultiply(const Vec2d &lhs, const Vec2d &rhs)
const Vec2f operator-() const