#include <Vector3.h>
Public Member Functions | |
Vector3 (const Type &x=0, const Type &y=0, const Type &z=0) | |
const Type | getLength () const |
const Type | getSquaredLength () const |
const Vector3< Type > & | normalize () |
Vector3< Type > | getNormalized () const |
Vector3< Type > | getRotated (const Vector3< Type > &vecAxis, const Type &angle) const |
double | getDistance (const Vector3< Type > &vec) const |
Type | getAngleBetween (const Vector3< Type > &vec) const |
Vector3< Type > | getPerpendicular () const |
Static Public Member Functions | |
static Vector3< Type > | lerp (const Vector3< Type > &vec1, const Vector3< Type > &vec2, const double &t) |
Related Functions | |
(Note that these are not member functions.) | |
template<class Type > | |
Vector3< Type > | operator- (const Vector3< Type > &vec) |
template<class Type > | |
const Type | operator* (const Vector3< Type > &lhs, const Vector3< Type > &rhs) |
template<class Type > | |
Vector3< Type > | operator% (const Vector3< Type > &lhs, const Vector3< Type > &rhs) |
template<class Type > | |
Vector3< Type > | operator+ (const Vector3< Type > &lhs, const Vector3< Type > &rhs) |
template<class Type > | |
Vector3< Type > | operator* (const Vector3< Type > &lhs, const Type &rhs) |
template<class Type > | |
Vector3< Type > | operator* (const Type &lhs, const Vector3< Type > &rhs) |
template<class Type > | |
Vector3< Type > | operator/ (const Vector3< Type > &lhs, const Type &rhs) |
template<class Type > | |
bool | equals (const Vector3< Type > &lhs, const Vector3< Type > &rhs, double fEpsilon=EPSILON) |
template<class Type > | |
bool | operator== (const Vector3< Type > &lhs, const Vector3< Type > &rhs) |
template<class Type > | |
bool | operator!= (const Vector3< Type > &lhs, const Vector3< Type > &rhs) |
template<class Type > | |
std::ostream & | operator<< (std::ostream &stream, const Vector3< Type > &vec) |
template<class Type > | |
std::istream & | operator>> (std::istream &stream, Vector3< Type > &vec) |
template<class Type > | |
Type | distance (const Vector3< Type > &vec1, const Vector3< Type > &vec2) |
template<typename Type > | |
Vector3< Type > | minimum (const Vector3< Type > &lhs, const Vector3< Type > &rhs) |
template<typename Type > | |
Vector3< Type > | maximum (const Vector3< Type > &lhs, const Vector3< Type > &rhs) |
This represents a 3-dimensional vector
ARSTD::Vector3< Type >::Vector3 | ( | const Type & | x = 0 , |
const Type & | y = 0 , |
||
const Type & | z = 0 |
||
) |
Constructs a vector from given components
x | x-component |
y | y-component |
z | z-component |
Type ARSTD::Vector3< Type >::getAngleBetween | ( | const Vector3< Type > & | vec | ) | const |
Returns the angle the given vector
double ARSTD::Vector3< Type >::getDistance | ( | const Vector3< Type > & | vec | ) | const |
Returns the distance to given vector
const Type ARSTD::Vector3< Type >::getLength | ( | ) | const |
Returns the length
Vector3< Type > ARSTD::Vector3< Type >::getNormalized | ( | ) | const |
Returns the normalized version of this vector
Vector3< Type > ARSTD::Vector3< Type >::getPerpendicular | ( | ) | const |
Returns a some perpendicular vector
Vector3< Type > ARSTD::Vector3< Type >::getRotated | ( | const Vector3< Type > & | vecAxis, |
const Type & | angle | ||
) | const |
Rotates the vector around given axis and angle
vecAxis | the axis the vector is rotated around |
angle | the angle the vector is rotated around in rad |
const Type ARSTD::Vector3< Type >::getSquaredLength | ( | ) | const |
Returns the squared length
|
static |
Linear interpolation of two vectors
const Vector3< Type > & ARSTD::Vector3< Type >::normalize | ( | ) |
Normalizes the vector to a length of 1
|
related |
Calculates the distance between to vectors
|
related |
Compares two vectors with the epsilon given by the parameter fEpsilon
|
related |
Calculates the component wise maximal vector from the given ones
|
related |
Calculates the component wise minimal vector from the given ones
|
related |
Compares two matrices using default EPSILON
|
related |
Calculates the cross product
|
related |
Multiplies a scalar by each component of a vector
|
related |
Multiplies a scalar by each component of a vector
|
related |
Calculates the dot product
|
related |
Calculates the addition
Negates all components
|
related |
Divides each component of a vector by a scalar
|
related |
Writes the vector to a std output stream
|
related |
Compares two matrices using default EPSILON
|
related |
Reads the vector from a std input stream