Public Member Functions | |
Vector4 () | |
Vector4 (const double &x, const double &y, const double &z, const double &w) | |
double | getLength () const |
double | getSquaredLength () const |
const Vector4 & | normalize () |
Vector4 | getNormalized () const |
Public Attributes | |
double | x |
The first component. | |
double | y |
The second component. | |
double | z |
The third component. | |
double | w |
The fourth component. | |
double | r |
Alias of first component. | |
double | g |
Alias of second component. | |
double | b |
Alias of third component. | |
double | a |
Alias of fourth component. |
ARSTD::Vector4::Vector4 | ( | ) |
Default constructor. Sets all members to zero
ARSTD::Vector4::Vector4 | ( | const double & | x, | |
const double & | y, | |||
const double & | z, | |||
const double & | w | |||
) |
Constructor, that initializes the members with the parameters.
x | x-component | |
y | y-component | |
z | z-component | |
w | w-component |
double ARSTD::Vector4::getLength | ( | ) | const |
Returns the length of the vector.
double ARSTD::Vector4::getSquaredLength | ( | ) | const |
Returns the squared length of the vector. Because the calculation of the length of a vector needs a squareroot operation this method can be used to calc with squared values.
const Vector4& ARSTD::Vector4::normalize | ( | ) |
Normalizes the vector to a length of 1.
Vector4 ARSTD::Vector4::getNormalized | ( | ) | const |
Returns the normalized version of this vector.