34 double& operator [](
int);
35 const double& operator [](
int)
const;
39 gmVector3& assign(
double,
double,
double);
64 double lengthSquared()
const;
68 void copyTo(
float [3])
const;
69 void copyTo(
double [3])
const;
70 void float2double(
const float *v);
71 void double2float(
const double *v);
101 v_[0] = v_[1] = v_[2] = 0;
106 v_[0] = v.
v_[0]; v_[1] = v.
v_[1]; v_[2] = v.
v_[2];
111 v_[0] = x; v_[1] = y; v_[2] = z;
118 assert(i == 0 || i == 1 || i == 2);
124 assert(i == 0 || i == 1 || i == 2);
132 v_[0] = x; v_[1] = y; v_[2] = z;
138 v_[0] = v[0]; v_[1] = v[1]; v_[2] = v[2];
146 v_[0] += v[0]; v_[1] += v[1]; v_[2] += v[2];
152 v_[0] -= v[0]; v_[1] -= v[1]; v_[2] -= v[2];
158 v_[0] *= c; v_[1] *= c; v_[2] *= c;
165 v_[0] /= c; v_[1] /= c; v_[2] /= c;
171 return gmVector3(v_[0] + v[0], v_[1] + v[1], v_[2] + v[2]);
176 return gmVector3(v_[0] - v[0], v_[1] - v[1], v_[2] - v[2]);
181 return gmVector3(-v_[0], -v_[1], -v_[2]);
186 return gmVector3(v_[0] * c, v_[1] * c, v_[2] * c);
192 return gmVector3(v_[0] / c, v_[1] / c, v_[2] / c);
197 return gmVector3(c * v[0], c * v[1], c * v[2]);
208 return (!(*
this == v));
244 f[0] = v_[0]; f[1] = v_[1]; f[2] = v_[2];
249 f[0] = v_[0]; f[1] = v_[1]; f[2] = v_[2];
254 v_[0] = (double) v[0];
255 v_[1] = (double) v[1];
256 v_[2] = (double) v[2];
272 return gmVector3(v1[1] * v2[2] - v1[2] * v2[1],
273 v1[2] * v2[0] - v1[0] * v2[2],
274 v1[0] * v2[1] - v1[1] * v2[0]);
280 sqrt(
gmSqr(v1[0] - v2[0]) +
gmSqr(v1[1] - v2[1]) +
gmSqr(v1[2] - v2[2]));
285 return gmSqr(v1[0] - v2[0]) +
gmSqr(v1[1] - v2[1]) +
gmSqr(v1[2] - v2[2]);
290 return v1[0] * v2[0] + v1[1] * v2[1] + v1[2] * v2[2];
295 return v1 + ((v2 - v1) * f);
306 d =
dot(plane_norm, v);
314 return dot(plane_norm, tmp) / d;
338 os <<
"< " << v[0] <<
" " << v[1] <<
" " << v[2] <<
" >";