#include "Vector3.h"
#include "Structs.h"
Functions | |
void | addVector (Vector3 *vector, Vector3 *vector1, Vector3 *vector2) |
void | subtractVector (Vector3 *vector, Vector3 *vector1, Vector3 *vector2) |
void | multVector (Vector3 *vector, Vector3 *vector1, GLfloat scalar) |
void | scaleVector (Vector3 *vector, Vector3 *vector1, GLfloat scalar) |
float | getSquaredLength (Vector3 *vector) |
float | getDotProduct (Vector3 *vector1, Vector3 *vector2) |
float | getDotProduct (Gradient *grad, Vector3 *vector) |
void | setVector (Vector3 *vector, float x, float y, float z) |
----------------------------------------------------------------setVector()- | |
void | normalizeVector (Vector3 *vector1, Vector3 *vector2) |
Vector3 * | calcVectorCrossProduct (Vector3 *vector, Vector3 *vector1, Vector3 *vector2) |
float | calcAngle (Vector3 *vector1, Vector3 *vector2) |
void | rotateVector (Vector3 *vector, Vector3 *vector1, Vector3 *vector2, float angle) |
void | matrixMulVector (Vector3 *vector, matrix44 *matr, Vector3 *vector1) |
void | loadIdentity (matrix44 *matrix) |
void | matrixMulMatrix (matrix44 *matrix, matrix44 *matr1, matrix44 *matr2) |
void | translateMatrix (matrix44 *matrix, float x_direction, float y_direction, float z_direction) |
void | scaleMatrix (matrix44 *matrix, float x_direction, float y_direction, float z_direction) |
void | rotateMatrix (matrix44 *matrix, float x, float y, float z, float angle) |
VectorOperations.cpp - This file contains the definition of the vector operations.
This returns the angle between two vectors.
vector1 | The first vector for calculate the angle. | |
vector2 | The second vector for calculate the angle. |
This calculates the crossprodukt of two vectors.
vector | In this parameter the result of the cross product operations will be stored. | |
vector1 | The first vector for calculate the cross produkt. | |
vector2 | The second vector for calculate the cross produkt. |
This returns the dot product of the vector.
gradient | The gradient for calculate the dot produkt. | |
vector | The second vector for calculate the dot produkt. |
This returns the dot product of the vector.
vector1 | The first vector for calculate the dot produkt. | |
vector2 | The second vector for calculate the dot produkt. |
float getSquaredLength | ( | Vector3 * | vector | ) |
This returns the squared length of the vector.
void loadIdentity | ( | matrix44 * | matrix | ) |
This sets the identity matrix.
matrix | The matrix to reset to the identity matrix. |
This multiplies a matrix with another matrix.
matrix | The matrix for calculate the produkt. | |
matr1 | The first matrix for the multiplication. | |
matr2 | The second matrix for the multiplication. |
This returns a vector multiplied with a matrix.
vector | The vector for calculate produkt. | |
matr | The matrix to multiplie with the vector. | |
vector1 | The vector to multiplie with the matrix. |
Operator overoading of * to multiply this vector with a skalar.
vector1 | The vector to multiplie with the scale factor. | |
scalar | The scale factor. |
This normalizes the vector
vector | In this parameter the result of the normalization will be stored. | |
vector1 | The vector to normalize. |
void rotateMatrix | ( | matrix44 * | matrix, | |
float | x, | |||
float | y, | |||
float | z, | |||
float | angle | |||
) |
This rotates a matrix on the specified point around the specified angle.
x | The x coordinate of the point. | |
y | The y coordinate of the point. | |
z | The z coordinate of the point. | |
angle | The rotation angle. |
This returns the vector rotated in the direction of vector2 and the specified angle.
vector1 | The vector which should be rotated. | |
vector2 | The dirction vector of the rotation. | |
angle | The rotation angle. |
void scaleMatrix | ( | matrix44 * | matrix, | |
float | x_direction, | |||
float | y_direction, | |||
float | z_direction | |||
) |
This scales a matrix with the specified scale factors of each direction.
x_direction | The scale factor along the x-direction. | |
y_direction | The scale factor along the y-direction. | |
z_direction | The scale factor along the z-direction. |
Operator overoading of / to divide this vector by a skalar.
vector1 | The vector to divide by the scale factor. | |
scalar | The scale factor. |
void setVector | ( | Vector3 * | vector, | |
float | x, | |||
float | y, | |||
float | z | |||
) |
----------------------------------------------------------------setVector()-
----------------------------------------------------------------setVector()-
This sets the values of the vector.
vector | The vector in which the values should be inserted. | |
x | The new x coordinate. | |
y | The new y coordinate. | |
z | The new z coordinate. |
Operator overoading of - to subtract vectors.
vector1 | The first vector to subtract. | |
vector2 | The second vector to subtract. |
void translateMatrix | ( | matrix44 * | matrix, | |
float | x_direction, | |||
float | y_direction, | |||
float | z_direction | |||
) |
This translates a matrix to the specified location.
x_direction | The direction along the x-axis. | |
y_direction | The direction along the y-axis. | |
z_direction | The direction along the z-axis. |