41 Vec3f() { _v[0]=0.0f; _v[1]=0.0f; _v[2]=0.0f;}
42 Vec3f(value_type
x,value_type
y,value_type
z) { _v[0]=
x; _v[1]=
y; _v[2]=
z; }
57 if (_v[0]<v.
_v[0])
return true;
58 else if (_v[0]>v.
_v[0])
return false;
59 else if (_v[1]<v.
_v[1])
return true;
60 else if (_v[1]>v.
_v[1])
return false;
61 else return (_v[2]<v.
_v[2]);
64 inline value_type*
ptr() {
return _v; }
65 inline const value_type*
ptr()
const {
return _v; }
67 inline void set( value_type
x, value_type
y, value_type
z)
69 _v[0]=
x; _v[1]=
y; _v[2]=
z;
74 _v[0]=rhs.
_v[0]; _v[1]=rhs.
_v[1]; _v[2]=rhs.
_v[2];
80 inline value_type&
x() {
return _v[0]; }
81 inline value_type&
y() {
return _v[1]; }
82 inline value_type&
z() {
return _v[2]; }
84 inline value_type
x()
const {
return _v[0]; }
85 inline value_type
y()
const {
return _v[1]; }
86 inline value_type
z()
const {
return _v[2]; }
96 return _v[0]*rhs.
_v[0]+_v[1]*rhs.
_v[1]+_v[2]*rhs.
_v[2];
102 return Vec3f(_v[1]*rhs.
_v[2]-_v[2]*rhs.
_v[1],
103 _v[2]*rhs.
_v[0]-_v[0]*rhs.
_v[2] ,
104 _v[0]*rhs.
_v[1]-_v[1]*rhs.
_v[0]);
110 return Vec3f(_v[0]*rhs, _v[1]*rhs, _v[2]*rhs);
125 return Vec3f(_v[0]/rhs, _v[1]/rhs, _v[2]/rhs);
140 return Vec3f(_v[0]+rhs.
_v[0], _v[1]+rhs.
_v[1], _v[2]+rhs.
_v[2]);
157 return Vec3f(_v[0]-rhs.
_v[0], _v[1]-rhs.
_v[1], _v[2]-rhs.
_v[2]);
172 return Vec3f (-_v[0], -_v[1], -_v[2]);
178 return sqrtf( _v[0]*_v[0] + _v[1]*_v[1] + _v[2]*_v[2] );
184 return _v[0]*_v[0] + _v[1]*_v[1] + _v[2]*_v[2];
195 value_type inv = 1.0f/norm;
208 return Vec3f(lhs[0]*rhs[0], lhs[1]*rhs[1], lhs[2]*rhs[2]);
214 return Vec3f(lhs[0]/rhs[0], lhs[1]/rhs[1], lhs[2]/rhs[2]);
217 const Vec3f
X_AXIS(1.0,0.0,0.0);
218 const Vec3f
Y_AXIS(0.0,1.0,0.0);
219 const Vec3f
Z_AXIS(0.0,0.0,1.0);
const Vec3f operator^(const Vec3f &rhs) const
Vec3f(const Vec2f &v2, value_type zz)
const Vec3f X_AXIS(1.0, 0.0, 0.0)
value_type length2() const
Vec3f & operator*=(value_type rhs)
const Vec3f operator/(value_type rhs) const
Vec3f & operator-=(const Vec3f &rhs)
bool operator==(const Vec3f &v) const
Vec2d componentDivide(const Vec2d &lhs, const Vec2d &rhs)
const value_type * ptr() const
void set(const Vec3f &rhs)
Vec3f & operator+=(const Vec3f &rhs)
const Vec3f Y_AXIS(0.0, 1.0, 0.0)
void set(value_type x, value_type y, value_type z)
value_type & operator[](int i)
bool operator!=(const Vec3f &v) const
Vec3f & operator/=(value_type rhs)
const Vec3f Z_AXIS(0.0, 0.0, 1.0)
value_type operator*(const Vec3f &rhs) const
Vec3f(value_type x, value_type y, value_type z)
const Vec3f operator-() const
value_type length() const
bool operator<(const Vec3f &v) const
const Vec3f operator+(const Vec3f &rhs) const
Vec2d componentMultiply(const Vec2d &lhs, const Vec2d &rhs)