a 3d vector template class for representing vectors and points in 3d More...
#include <ik_vec3d.h>
Public Member Functions | |
vec3d () | |
vec3d (T nx, T ny, T nz) | |
vec3d (const vec3d< T > &other) | |
vec3d< T > | operator- () const |
constructor creating an irrklang vec3d from an irrlicht vector. | |
vec3d< T > & | operator= (const vec3d< T > &other) |
vec3d< T > | operator+ (const vec3d< T > &other) const |
vec3d< T > & | operator+= (const vec3d< T > &other) |
vec3d< T > | operator- (const vec3d< T > &other) const |
vec3d< T > & | operator-= (const vec3d< T > &other) |
vec3d< T > | operator* (const vec3d< T > &other) const |
vec3d< T > & | operator*= (const vec3d< T > &other) |
vec3d< T > | operator* (const T v) const |
vec3d< T > & | operator*= (const T v) |
vec3d< T > | operator/ (const vec3d< T > &other) const |
vec3d< T > & | operator/= (const vec3d< T > &other) |
vec3d< T > | operator/ (const T v) const |
vec3d< T > & | operator/= (const T v) |
bool | operator<= (const vec3d< T > &other) const |
bool | operator>= (const vec3d< T > &other) const |
bool | operator== (const vec3d< T > &other) const |
bool | operator!= (const vec3d< T > &other) const |
bool | equals (const vec3d< T > &other) |
returns if this vector equalsfloat the other one, taking floating point rounding errors into account | |
void | set (const T nx, const T ny, const T nz) |
void | set (const vec3d< T > &p) |
ik_f64 | getLength () const |
Returns length of the vector. | |
ik_f64 | getLengthSQ () const |
Returns squared length of the vector. | |
T | dotProduct (const vec3d< T > &other) const |
Returns the dot product with another vector. | |
ik_f64 | getDistanceFrom (const vec3d< T > &other) const |
Returns distance from an other point. | |
ik_f32 | getDistanceFromSQ (const vec3d< T > &other) const |
Returns squared distance from an other point. | |
vec3d< T > | crossProduct (const vec3d< T > &p) const |
Calculates the cross product with another vector. | |
bool | isBetweenPoints (const vec3d< T > &begin, const vec3d< T > &end) const |
Returns if this vector interpreted as a point is on a line between two other points. | |
vec3d< T > & | normalize () |
Normalizes the vector. | |
void | setLength (T newlength) |
Sets the lenght of the vector to a new value. | |
void | invert () |
Inverts the vector. | |
void | rotateXZBy (ik_f64 degrees, const vec3d< T > ¢er) |
void | rotateXYBy (ik_f64 degrees, const vec3d< T > ¢er) |
void | rotateYZBy (ik_f64 degrees, const vec3d< T > ¢er) |
vec3d< T > | getInterpolated (const vec3d< T > &other, ik_f32 d) const |
Returns interpolated vector. | |
vec3d< T > | getHorizontalAngle () |
Gets the Y and Z rotations of a vector. | |
void | getAs4Values (T *array) |
Fills an array of 4 values with the vector data (usually floats). | |
Public Attributes | |
T | X |
T | Y |
T | Z |
a 3d vector template class for representing vectors and points in 3d
irrklang::vec3d< T >::vec3d | ( | ) | [inline] |
irrklang::vec3d< T >::vec3d | ( | T | nx, | |
T | ny, | |||
T | nz | |||
) | [inline] |
irrklang::vec3d< T >::vec3d | ( | const vec3d< T > & | other | ) | [inline] |
vec3d<T> irrklang::vec3d< T >::crossProduct | ( | const vec3d< T > & | p | ) | const [inline] |
Calculates the cross product with another vector.
T irrklang::vec3d< T >::dotProduct | ( | const vec3d< T > & | other | ) | const [inline] |
Returns the dot product with another vector.
bool irrklang::vec3d< T >::equals | ( | const vec3d< T > & | other | ) | [inline] |
returns if this vector equalsfloat the other one, taking floating point rounding errors into account
void irrklang::vec3d< T >::getAs4Values | ( | T * | array | ) | [inline] |
Fills an array of 4 values with the vector data (usually floats).
Useful for setting in shader constants for example. The fourth value will always be 0.
ik_f64 irrklang::vec3d< T >::getDistanceFrom | ( | const vec3d< T > & | other | ) | const [inline] |
Returns distance from an other point.
Here, the vector is interpreted as point in 3 dimensional space.
ik_f32 irrklang::vec3d< T >::getDistanceFromSQ | ( | const vec3d< T > & | other | ) | const [inline] |
Returns squared distance from an other point.
Here, the vector is interpreted as point in 3 dimensional space.
vec3d<T> irrklang::vec3d< T >::getHorizontalAngle | ( | ) | [inline] |
Gets the Y and Z rotations of a vector.
Thanks to Arras on the Irrlicht forums to add this method.
vec3d<T> irrklang::vec3d< T >::getInterpolated | ( | const vec3d< T > & | other, | |
ik_f32 | d | |||
) | const [inline] |
Returns interpolated vector.
other,: | other vector to interpolate between | |
d,: | value between 0.0f and 1.0f. |
ik_f64 irrklang::vec3d< T >::getLength | ( | ) | const [inline] |
Returns length of the vector.
ik_f64 irrklang::vec3d< T >::getLengthSQ | ( | ) | const [inline] |
Returns squared length of the vector.
This is useful because it is much faster then getLength().
void irrklang::vec3d< T >::invert | ( | ) | [inline] |
Inverts the vector.
bool irrklang::vec3d< T >::isBetweenPoints | ( | const vec3d< T > & | begin, | |
const vec3d< T > & | end | |||
) | const [inline] |
Returns if this vector interpreted as a point is on a line between two other points.
It is assumed that the point is on the line.
vec3d<T>& irrklang::vec3d< T >::normalize | ( | ) | [inline] |
Normalizes the vector.
bool irrklang::vec3d< T >::operator!= | ( | const vec3d< T > & | other | ) | const [inline] |
vec3d<T> irrklang::vec3d< T >::operator* | ( | const T | v | ) | const [inline] |
vec3d<T> irrklang::vec3d< T >::operator* | ( | const vec3d< T > & | other | ) | const [inline] |
vec3d<T>& irrklang::vec3d< T >::operator*= | ( | const T | v | ) | [inline] |
vec3d<T>& irrklang::vec3d< T >::operator*= | ( | const vec3d< T > & | other | ) | [inline] |
vec3d<T> irrklang::vec3d< T >::operator+ | ( | const vec3d< T > & | other | ) | const [inline] |
vec3d<T>& irrklang::vec3d< T >::operator+= | ( | const vec3d< T > & | other | ) | [inline] |
vec3d<T> irrklang::vec3d< T >::operator- | ( | const vec3d< T > & | other | ) | const [inline] |
vec3d<T> irrklang::vec3d< T >::operator- | ( | ) | const [inline] |
vec3d<T>& irrklang::vec3d< T >::operator-= | ( | const vec3d< T > & | other | ) | [inline] |
vec3d<T> irrklang::vec3d< T >::operator/ | ( | const T | v | ) | const [inline] |
vec3d<T> irrklang::vec3d< T >::operator/ | ( | const vec3d< T > & | other | ) | const [inline] |
vec3d<T>& irrklang::vec3d< T >::operator/= | ( | const T | v | ) | [inline] |
vec3d<T>& irrklang::vec3d< T >::operator/= | ( | const vec3d< T > & | other | ) | [inline] |
bool irrklang::vec3d< T >::operator<= | ( | const vec3d< T > & | other | ) | const [inline] |
vec3d<T>& irrklang::vec3d< T >::operator= | ( | const vec3d< T > & | other | ) | [inline] |
bool irrklang::vec3d< T >::operator== | ( | const vec3d< T > & | other | ) | const [inline] |
bool irrklang::vec3d< T >::operator>= | ( | const vec3d< T > & | other | ) | const [inline] |
void irrklang::vec3d< T >::rotateXYBy | ( | ik_f64 | degrees, | |
const vec3d< T > & | center | |||
) | [inline] |
Rotates the vector by a specified number of degrees around the Z axis and the specified center.
degrees,: | Number of degrees to rotate around the Z axis. | |
center,: | The center of the rotation. |
void irrklang::vec3d< T >::rotateXZBy | ( | ik_f64 | degrees, | |
const vec3d< T > & | center | |||
) | [inline] |
Rotates the vector by a specified number of degrees around the Y axis and the specified center.
degrees,: | Number of degrees to rotate around the Y axis. | |
center,: | The center of the rotation. |
void irrklang::vec3d< T >::rotateYZBy | ( | ik_f64 | degrees, | |
const vec3d< T > & | center | |||
) | [inline] |
Rotates the vector by a specified number of degrees around the X axis and the specified center.
degrees,: | Number of degrees to rotate around the X axis. | |
center,: | The center of the rotation. |
void irrklang::vec3d< T >::set | ( | const vec3d< T > & | p | ) | [inline] |
void irrklang::vec3d< T >::set | ( | const T | nx, | |
const T | ny, | |||
const T | nz | |||
) | [inline] |
void irrklang::vec3d< T >::setLength | ( | T | newlength | ) | [inline] |
Sets the lenght of the vector to a new value.
T irrklang::vec3d< T >::X |
T irrklang::vec3d< T >::Y |
T irrklang::vec3d< T >::Z |
The irrKlang
Engine Documentation © 2003-2018 by Nikolaus Gebhardt. Generated
by Doxygen
(1.6.1) |