79 Vector3f(
const GLfloat _x,
const GLfloat _y,
const GLfloat _z)
187 return pow(
x,2) + pow(
y,2) + pow(
z,2);
233 if ((
x == 0) && (
y == 0) && (
z == 0))
246 inline GLvoid
set(
const GLfloat _x,
const GLfloat _y,
const GLfloat _z)
263 return x*v.
x +
y*v.
y +
z*v.
z;
274 GLfloat newx =
y*v.
z -
z*v.
y;
275 GLfloat newy =
z*v.
x -
x*v.
z;
276 GLfloat newz =
x*v.
y -
y*v.
x;
277 return new Vector3f(newx, newy, newz);
339 GLfloat newy =
y*cos(angle) -
z*sin(angle);
340 z =
y*sin(angle) +
z*cos(angle);
351 GLfloat newx =
x*cos(angle) +
z*sin(angle);
352 z = -
x*sin(angle) +
z*cos(angle);
363 GLfloat newx =
x*cos(angle) -
y*sin(angle);
364 y =
x*sin(angle) +
y*cos(angle);
379 GLfloat phi = atan2(axy.
x, axy.
y);
387 GLfloat theta = atan2(a1->
y, a1->
z);
408 if ((
x == 0) && (
z == 0))
428 return QString(
"x=" + QString::number(
x) +
" y=" + QString::number(
y) +
" z=" + QString::number(
z));
444 if ((v1.
x == v2.
x) && (v1.
y == v2.
y) && (v1.
z == v2.
z))
499 return operator*(v, a);
511 return operator*(v, -1);
GLfloat x
Definition: vector3f.h:33
GLvoid rotateX(const GLfloat angle)
Rotate on the x axis.
Definition: vector3f.h:337
GLvoid rotateY(const GLfloat angle)
Rotate on the y axis.
Definition: vector3f.h:349
GLvoid projectOnZX()
Compute the ZX plan projection.
Definition: vector3f.h:309
GLfloat z
Definition: vector3f.h:35
Vector3f(const GLfloat _x, const GLfloat _y, const GLfloat _z)
Create a Vector3f using the coordinates of parameters.
Definition: vector3f.h:79
GLvoid projectOnXZ()
Compute the XZ plan projection.
Definition: vector3f.h:301
GLfloat length()
Compute the length of the vector.
Definition: vector3f.h:199
GLvoid rotateZ(const GLfloat angle)
Rotate on the z axis.
Definition: vector3f.h:361
GLvoid rotate(const Vector3f &axis, const GLfloat angle)
Rotate on the parameter given axis.
Definition: vector3f.h:374
GLvoid set(const GLfloat _x, const GLfloat _y, const GLfloat _z)
Set the vector coordinates.
Definition: vector3f.h:246
GLvoid projectOnYX()
Compute the YX plan projection.
Definition: vector3f.h:293
GLvoid zero()
Set all cordinates of the vector to zero.
Definition: vector3f.h:218
GLfloat dot(const Vector3f &v)
Compute the dot product of the vector with the vector v.
Definition: vector3f.h:261
GLvoid projectOnZY()
Compute the ZY plan projection.
Definition: vector3f.h:325
Vector3f * cross(const Vector3f &v)
Compute the cross product of the vector with the vector v.
Definition: vector3f.h:272
Vector3f()
Create a new Vector3f in coordinates (0, 0, 0).
Definition: vector3f.h:41
GLvoid projectOnYZ()
Compute the YZ plan projection.
Definition: vector3f.h:317
GLvoid copyInto(GLfloat a[3])
Copy the array a content in the vector.
Definition: vector3f.h:127
Structure that rapresents a Vector of float in a 3-D space.
Definition: vector3f.h:31
GLfloat & operator[](GLint i)
Operator [] overloading function.
Definition: vector3f.h:140
Vector3f(const Vector3f *v)
Create a new Vector3f copying the coordinates of v.
Definition: vector3f.h:65
Vector3f(const Vector3f &v)
Create a new Vector3f copying the coordinates of v.
Definition: vector3f.h:53
Vector3f(const GLfloat a[3])
Create a Vector3f using the coordinates of array a[].
Definition: vector3f.h:91
GLvoid operator=(const GLfloat a[3])
Operator = overloading function.
Definition: vector3f.h:103
GLvoid projectOnXY()
Compute the XY plan projection.
Definition: vector3f.h:285
GLfloat y
Definition: vector3f.h:34
GLvoid normalize()
Normalize a vector.
Definition: vector3f.h:207
GLvoid operator+=(const Vector3f a)
Operator += overloading function.
Definition: vector3f.h:115
GLboolean isZero()
Check if the vector is (0, 0, 0).
Definition: vector3f.h:231
GLfloat lengthSq()
Compute the length^2 of the vector.
Definition: vector3f.h:185
QString toString()
Return the QString of coordinates.
Definition: vector3f.h:426
const GLfloat & operator[](GLint i) const
Operator [] overloading function.
Definition: vector3f.h:162
Vector3f * getOneOrthogonal()
Compute one of the orthogonal vectors of the vector.
Definition: vector3f.h:405