3D vector More...
#include <line_ray.h>
Public Types | |
typedef Type | datatype |
Public Member Functions | |
Vec3 () | |
Vec3 (const Type &p1, const Type &p2, const Type &p3) | |
Vec3 (const Type &scalar) | |
Vec3 (const Type *array_xyz) | |
Vec3 (const Vec2< Type > ©, const Type &p3) | |
Vec3 (const Vec3< double > ©) | |
Vec3 (const Vec3< double > ©) | |
Vec3 (const Vec3< double > ©) | |
Vec3 (const Vec3< double > ©) | |
Vec3 (const Vec3< double > ©) | |
Vec3 (const Vec3< double > ©) | |
Vec3 (const Vec3< double > ©) | |
Vec3 (const Vec3< double > ©) | |
Vec3 (const Vec3< double > ©) | |
Vec3 (const Vec3< float > ©) | |
Vec3 (const Vec3< float > ©) | |
Vec3 (const Vec3< float > ©) | |
Vec3 (const Vec3< float > ©) | |
Vec3 (const Vec3< float > ©) | |
Vec3 (const Vec3< float > ©) | |
Vec3 (const Vec3< float > ©) | |
Vec3 (const Vec3< float > ©) | |
Vec3 (const Vec3< float > ©) | |
Vec3 (const Vec3< int > ©) | |
Vec3 (const Vec3< int > ©) | |
Vec3 (const Vec3< int > ©) | |
Vec3 (const Vec3< int > ©) | |
Vec3 (const Vec3< int > ©) | |
Vec3 (const Vec3< int > ©) | |
Vec3 (const Vec3< int > ©) | |
Vec3 (const Vec3< int > ©) | |
Vec3 (const Vec3< int > ©) | |
Vec3 (const Vec4< Type > ©) | |
double | length () const |
float | length () const |
Attributes | |
Type | length () const |
Returns the length (magnitude) of this vector. More... | |
Vec3< Type > & | normalize () |
Normalizes this vector. More... | |
Type | dot (const Vec3< Type > &vector) const |
Dot products this vector with an other vector. More... | |
Angle | angle (const Vec3< Type > &vector) const |
Calculate the angle between this vector and an other vector. More... | |
Angle | angle_normed (const Vec3< Type > &vector) const |
Calculate the angle between this vector and an other vector, where the vectors are unit vectors. More... | |
Type | distance (const Vec3< Type > &vector) const |
Calculate the distance between this vector and an other vector. More... | |
Vec3< Type > & | cross (const Vec3< Type > &vector) |
Calculate the cross product between this vector and an other vector. More... | |
Vec3< Type > & | rotate (const Angle &angle, const Vec3< Type > &axis) |
Rotate this vector around an axis. Same as glRotate[f|d](angle, a);. More... | |
Vec3< Type > & | round () |
Rounds all components on this vector. More... | |
bool | is_equal (const Vec3< Type > &other, Type epsilon) const |
Returns true if equal within the bounds of an epsilon. More... | |
Operators | |
void | operator+= (const Vec3< Type > &vector) |
+= operator. More... | |
void | operator+= (Type value) |
+= operator. More... | |
void | operator-= (const Vec3< Type > &vector) |
-= operator. More... | |
void | operator-= (Type value) |
-= operator. More... | |
Vec3< Type > | operator- () const |
| |
void | operator*= (const Vec3< Type > &vector) |
*= operator. More... | |
void | operator*= (Type value) |
*= operator. More... | |
void | operator/= (const Vec3< Type > &vector) |
/= operator. More... | |
void | operator/= (Type value) |
/= operator. More... | |
Vec3< Type > & | operator= (const Vec3< Type > &vector) |
= operator. More... | |
bool | operator== (const Vec3< Type > &vector) const |
== operator. More... | |
bool | operator!= (const Vec3< Type > &vector) const |
!= operator. More... | |
bool | operator< (const Vec3< Type > &vector) const |
< operator. More... | |
Static Public Member Functions | |
static Vec3< Type > | cross (const Vec3< Type > &vector1, const Vec3< Type > &vector2) |
Calculate the cross product between two vectors. More... | |
static Type | dot (const Vec3< Type > &vector1, const Vec3< Type > &vector2) |
Dot products between two vectors. More... | |
static bool | is_equal (const Vec3< Type > &first, const Vec3< Type > &second, Type epsilon) |
Returns true if equal within the bounds of an epsilon. More... | |
static Vec3< Type > | normalize (const Vec3< Type > &vector) |
Normalizes a vector. More... | |
static Vec3< Type > | reflect (const Vec3< Type > &incident, const Vec3< Type > &normal) |
Calculate the reflection direction for an incident vector. More... | |
static Vec3< Type > | rotate (const Vec3< Type > &vector, const Angle &angle, const Vec3< Type > &axis) |
Rotate a vector around an axis. Same as glRotate[f|d](angle, a);. More... | |
static Vec3< Type > | round (const Vec3< Type > &vector) |
Rounds all components on a vector. More... | |
Public Attributes | |
union { | |
Type clan::Vec3< Type >::r | |
Type clan::Vec3< Type >::s | |
Type clan::Vec3< Type >::x | |
}; | |
union { | |
Type clan::Vec3< Type >::g | |
Type clan::Vec3< Type >::t | |
Type clan::Vec3< Type >::y | |
}; | |
union { | |
Type clan::Vec3< Type >::b | |
Type clan::Vec3< Type >::u | |
Type clan::Vec3< Type >::z | |
}; | |
3D vector
These vector templates are defined for:
char (Vec3c), unsigned char (Vec3uc), short (Vec3s),
unsigned short (Vec3us), int (Vec3i), unsigned int (Vec3ui), float (Vecdf), double (Vec3d)
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |