Structure that rapresents a Vector of float in a 3-D space. More...
#include <vector3f.h>
Public Member Functions | |
Vector3f () | |
Create a new Vector3f in coordinates (0, 0, 0). | |
Vector3f (const Vector3f &v) | |
Create a new Vector3f copying the coordinates of v. More... | |
Vector3f (const Vector3f *v) | |
Create a new Vector3f copying the coordinates of v. More... | |
Vector3f (const GLfloat _x, const GLfloat _y, const GLfloat _z) | |
Create a Vector3f using the coordinates of parameters. More... | |
Vector3f (const GLfloat a[3]) | |
Create a Vector3f using the coordinates of array a[]. More... | |
GLvoid | operator= (const GLfloat a[3]) |
Operator = overloading function. More... | |
GLvoid | operator+= (const Vector3f a) |
Operator += overloading function. More... | |
GLvoid | copyInto (GLfloat a[3]) |
Copy the array a content in the vector. More... | |
GLfloat & | operator[] (GLint i) |
Operator [] overloading function. More... | |
const GLfloat & | operator[] (GLint i) const |
Operator [] overloading function. More... | |
GLfloat | lengthSq () |
Compute the length^2 of the vector. More... | |
GLfloat | length () |
Compute the length of the vector. More... | |
GLvoid | normalize () |
Normalize a vector. | |
GLvoid | zero () |
Set all cordinates of the vector to zero. | |
GLboolean | isZero () |
Check if the vector is (0, 0, 0). More... | |
GLvoid | set (const GLfloat _x, const GLfloat _y, const GLfloat _z) |
Set the vector coordinates. More... | |
GLfloat | dot (const Vector3f &v) |
Compute the dot product of the vector with the vector v. More... | |
Vector3f * | cross (const Vector3f &v) |
Compute the cross product of the vector with the vector v. More... | |
GLvoid | projectOnXY () |
Compute the XY plan projection. | |
GLvoid | projectOnYX () |
Compute the YX plan projection. | |
GLvoid | projectOnXZ () |
Compute the XZ plan projection. | |
GLvoid | projectOnZX () |
Compute the ZX plan projection. | |
GLvoid | projectOnYZ () |
Compute the YZ plan projection. | |
GLvoid | projectOnZY () |
Compute the ZY plan projection. | |
GLvoid | rotateX (const GLfloat angle) |
Rotate on the x axis. More... | |
GLvoid | rotateY (const GLfloat angle) |
Rotate on the y axis. More... | |
GLvoid | rotateZ (const GLfloat angle) |
Rotate on the z axis. More... | |
GLvoid | rotate (const Vector3f &axis, const GLfloat angle) |
Rotate on the parameter given axis. More... | |
Vector3f * | getOneOrthogonal () |
Compute one of the orthogonal vectors of the vector. More... | |
QString | toString () |
Return the QString of coordinates. More... | |
Public Attributes | |
GLfloat | x |
GLfloat | y |
GLfloat | z |
Structure that rapresents a Vector of float in a 3-D space.
|
inline |
Create a new Vector3f copying the coordinates of v.
v | is the other vector to copy coordinates. |
|
inline |
Create a new Vector3f copying the coordinates of v.
v | is the other vector to copy coordinates. |
|
inline |
Create a Vector3f using the coordinates of parameters.
_x | is the coordinate of x. |
_y | is the coordinate of y. |
_z | is the coordinate of z. |
|
inline |
Create a Vector3f using the coordinates of array a[].
a[] | is the array to copy coordinates. |
|
inline |
Copy the array a content in the vector.
a[] | is the array to copy coordinates. |
Compute the cross product of the vector with the vector v.
v | the other vector to compute the cross product. |
|
inline |
Compute the dot product of the vector with the vector v.
v | the other vector to compute the dot product. |
|
inline |
Compute one of the orthogonal vectors of the vector.
|
inline |
Check if the vector is (0, 0, 0).
|
inline |
Compute the length of the vector.
If you have to check only which vector among others is longer you can use the lengthSq() function that is less resource expensive.
|
inline |
Compute the length^2 of the vector.
The length^2 is less resource expensive then length(). You can use it for check which vector is longer.
|
inline |
Operator += overloading function.
a | is the vector to sum to the current vector. |
|
inline |
Operator = overloading function.
a[] | is the array to copy coordinates. |
|
inline |
Operator [] overloading function.
i | is the index [1, 3]. |
|
inline |
Operator [] overloading function.
i | is the index [1, 3]. |
|
inline |
Rotate on the parameter given axis.
axis | is the axis on which compute the rotation. |
angle | is the angle of rotation. |
|
inline |
Rotate on the x axis.
angle | is the angle of rotation. |
|
inline |
Rotate on the y axis.
angle | is the angle of rotation. |
|
inline |
Rotate on the z axis.
angle | is the angle of rotation. |
|
inline |
Set the vector coordinates.
_x | is the coordinate of x. |
_y | is the coordinate of y. |
_z | is the coordinate of z. |
|
inline |
Return the QString of coordinates.
GLfloat Vector3f::x |
It is the x coordinate.
GLfloat Vector3f::y |
It is the y coordinate.
GLfloat Vector3f::z |
It is the z coordinate.