45 this->vec[0] = v[0]; this->vec[1] = v[1]; this->vec[2] = v[2];
48 SbVec3(
const Type x,
const Type y,
const Type z) {
49 this->vec[0] = x; this->vec[1] = y; this->vec[2] = z;
53 this->vec[0] = v[0]; this->vec[1] = v[1]; this->vec[2] = v[2];
58 this->vec[0] = x; this->vec[1] = y; this->vec[2] = z;
66 void getValue(Type & x, Type & y, Type & z)
const {
67 x = this->vec[0]; y = this->vec[1]; z = this->vec[2];
71 return SbVec3<Type>(this->vec[1]*v.vec[2] - this->vec[2]*v.vec[1],
72 this->vec[2]*v.vec[0] - this->vec[0]*v.vec[2],
73 this->vec[0]*v.vec[1] - this->vec[1]*v.vec[0]);
77 return this->vec[0]*v.vec[0] + this->vec[1]*v.vec[1] + this->vec[2]*v.vec[2];
81 return this->vec[0]*this->vec[0] + this->vec[1]*this->vec[1] + this->vec[2]*this->vec[2];
89 const double len = this->
length();
97 this->vec[0] = -this->vec[0];
98 this->vec[1] = -this->vec[1];
99 this->vec[2] = -this->vec[2];
114 this->vec[0] += u.vec[0];
115 this->vec[1] += u.vec[1];
116 this->vec[2] += u.vec[2];
120 this->vec[0] -= u.vec[0];
121 this->vec[1] -= u.vec[1];
122 this->vec[2] -= u.vec[2];
127 return SbVec3<Type>(-this->vec[0], -this->vec[1], -this->vec[2]);
131 return SbVec3<Type>(this->vec[0] + v.vec[0], this->vec[1] + v.vec[1], this->vec[2] + v.vec[2]);
135 return SbVec3<Type>(this->vec[0] - v.vec[0], this->vec[1] - v.vec[1], this->vec[2] - v.vec[2]);
139 return SbVec3<Type>(this->vec[0] * f, this->vec[1] * f, this->vec[2] * f);
143 return SbVec3<Type>(this->vec[0] / f, this->vec[1] / f, this->vec[2] / f);
147 return this->vec[idx];
151 return this->vec[idx];
159 #endif // !COIN_SBVEC3_H SbVec3(const Type x, const Type y, const Type z)
Definition: SbVec3.h:48
SbVec3< Type > & operator-=(const SbVec3< Type > &u)
Definition: SbVec3.h:119
SbVec3< Type > & operator*=(const Type d)
Definition: SbVec3.h:102
SbVec3< Type > operator*(Type f) const
Definition: SbVec3.h:138
SbVec3< Type > & operator/=(const Type d)
Definition: SbVec3.h:109
double length(void) const
Definition: SbVec3.h:84
Type sqrLength(void) const
Definition: SbVec3.h:80
Type & operator[](int idx)
Definition: SbVec3.h:146
SbVec3< Type > operator/(Type f) const
Definition: SbVec3.h:142
SbVec3< Type > & setValue(const Type x, const Type y, const Type z)
Definition: SbVec3.h:57
SbVec3< Type > & operator+=(const SbVec3< Type > &u)
Definition: SbVec3.h:113
SbVec3< Type > operator+(const SbVec3< Type > &v) const
Definition: SbVec3.h:130
Type dot(const SbVec3< Type > &v) const
Definition: SbVec3.h:76
const Type * getValue(void) const
Definition: SbVec3.h:62
SbVec3< Type > operator-(void) const
Definition: SbVec3.h:126
SbVec3< Type > cross(const SbVec3< Type > &v) const
Definition: SbVec3.h:70
void negate(void)
Definition: SbVec3.h:96
double normalize(void)
Definition: SbVec3.h:88
void getValue(Type &x, Type &y, Type &z) const
Definition: SbVec3.h:66
SbVec3(const Type v[3])
Definition: SbVec3.h:44
SbVec3< Type > & setValue(const Type v[3])
Definition: SbVec3.h:52
SbVec3(void)
Definition: SbVec3.h:42