ClanLib
2.3.7
|
3D vector More...
#include <line_ray.h>
Public Types | |
typedef Type | datatype |
Public Member Functions | |
CL_Vec3 () | |
CL_Vec3 (const CL_Vec2< Type > ©) | |
CL_Vec3 (const CL_Vec1< Type > ©) | |
CL_Vec3 (const CL_Vec4< Type > ©) | |
CL_Vec3 (const CL_Vec3< double > ©) | |
CL_Vec3 (const CL_Vec3< float > ©) | |
CL_Vec3 (const CL_Vec3< int > ©) | |
CL_Vec3 (const Type &p1, const Type &p2=0, const Type &p3=0) | |
CL_Vec3 (const Type *array_xyz) | |
template<> | |
CL_Vec3 (const CL_Vec3< float > ©) | |
template<> | |
CL_Vec3 (const CL_Vec3< double > ©) | |
template<> | |
CL_Vec3 (const CL_Vec3< int > ©) | |
template<> | |
CL_Vec3 (const CL_Vec3< float > ©) | |
template<> | |
CL_Vec3 (const CL_Vec3< double > ©) | |
template<> | |
CL_Vec3 (const CL_Vec3< int > ©) | |
template<> | |
CL_Vec3 (const CL_Vec3< float > ©) | |
template<> | |
CL_Vec3 (const CL_Vec3< double > ©) | |
template<> | |
CL_Vec3 (const CL_Vec3< int > ©) | |
template<> | |
CL_Vec3 (const CL_Vec3< float > ©) | |
template<> | |
CL_Vec3 (const CL_Vec3< double > ©) | |
template<> | |
CL_Vec3 (const CL_Vec3< int > ©) | |
template<> | |
CL_Vec3 (const CL_Vec3< float > ©) | |
template<> | |
CL_Vec3 (const CL_Vec3< double > ©) | |
template<> | |
CL_Vec3 (const CL_Vec3< int > ©) | |
Attributes | |
Type | length () const |
Returns the length (magnitude) of this vector. More... | |
CL_Vec3< Type > & | normalize () |
Normalizes this vector. More... | |
Type | dot (const CL_Vec3< Type > &vector) const |
Dot products this vector with an other vector. More... | |
CL_Angle | angle (const CL_Vec3< Type > &vector) const |
Calculate the angle between this vector and an other vector. More... | |
Type | distance (const CL_Vec3< Type > &vector) const |
Calculate the distance between this vector and an other vector. More... | |
CL_Vec3< Type > & | cross (const CL_Vec3< Type > &vector) |
Calculate the cross product between this vector and an other vector. More... | |
CL_Vec3< Type > & | rotate (const CL_Angle &angle, const CL_Vec3< Type > &axis) |
Rotate this vector around an axis. Same as glRotate[f|d](angle, a);. More... | |
CL_Vec3< Type > & | round () |
Rounds all components on this vector. More... | |
Operators | |
const Type & | operator[] (unsigned int i) const |
Type & | operator[] (unsigned int i) |
operator Type * () | |
operator Type *const () const | |
void | operator+= (const CL_Vec3< Type > &vector) |
+= operator. More... | |
void | operator+= (Type value) |
+= operator. More... | |
CL_Vec3< Type > | operator+ (const CL_Vec3< Type > &vector) const |
| |
CL_Vec3< Type > | operator+ (Type value) const |
| |
void | operator-= (const CL_Vec3< Type > &vector) |
-= operator. More... | |
void | operator-= (Type value) |
-= operator. More... | |
CL_Vec3< Type > | operator- (const CL_Vec3< Type > &vector) const |
| |
CL_Vec3< Type > | operator- (Type value) const |
| |
void | operator*= (const CL_Vec3< Type > &vector) |
*= operator. More... | |
void | operator*= (Type value) |
*= operator. More... | |
CL_Vec3< Type > | operator* (const CL_Vec3< Type > &vector) const |
| |
CL_Vec3< Type > | operator* (Type value) const |
| |
void | operator/= (const CL_Vec3< Type > &vector) |
/= operator. More... | |
void | operator/= (Type value) |
/= operator. More... | |
CL_Vec3< Type > | operator/ (const CL_Vec3< Type > &vector) const |
/ operator. More... | |
CL_Vec3< Type > | operator/ (Type value) const |
/ operator. More... | |
CL_Vec3< Type > & | operator= (const CL_Vec3< Type > &vector) |
= operator. More... | |
bool | operator== (const CL_Vec3< Type > &vector) const |
== operator. More... | |
bool | operator!= (const CL_Vec3< Type > &vector) const |
!= operator. More... | |
Static Public Member Functions | |
static CL_Vec3< Type > | cross (const CL_Vec3< Type > &vector1, const CL_Vec3< Type > &vector2) |
Calculate the cross product between two vectors. More... | |
static Type | dot (const CL_Vec3< Type > &vector1, const CL_Vec3< Type > &vector2) |
Dot products between two vectors. More... | |
static CL_Vec3< Type > | normalize (const CL_Vec3< Type > &vector) |
Normalizes a vector. More... | |
static CL_Vec3< Type > | rotate (const CL_Vec3< Type > &vector, const CL_Angle &angle, const CL_Vec3< Type > &axis) |
Rotate a vector around an axis. Same as glRotate[f|d](angle, a);. More... | |
static CL_Vec3< Type > | round (const CL_Vec3< Type > &vector) |
Rounds all components on a vector. More... | |
Public Attributes | |
union { | |
Type r | |
Type s | |
Type x | |
}; | |
union { | |
Type g | |
Type t | |
Type y | |
}; | |
union { | |
Type b | |
Type u | |
Type z | |
}; | |
3D vector
These vector templates are defined for:
char (CL_Vec3c), unsigned char (CL_Vec3uc), short (CL_Vec3s),
unsigned short (CL_Vec3us), int (CL_Vec3i), unsigned int (CL_Vec3ui), float (CL_Vecdf), double (CL_Vec3d)
|
inline |
References CL_Vec3< Type >::x, CL_Vec3< Type >::y, and CL_Vec3< Type >::z.
References CL_Vec3< Type >::x, CL_Vec3< Type >::y, and CL_Vec3< Type >::z.
References CL_Vec3< Type >::x, CL_Vec3< Type >::y, and CL_Vec3< Type >::z.
References CL_Vec3< Type >::x, CL_Vec3< Type >::y, and CL_Vec3< Type >::z.
References CL_Vec3< Type >::x, CL_Vec3< Type >::y, and CL_Vec3< Type >::z.
References CL_Vec3< Type >::x, CL_Vec3< Type >::y, and CL_Vec3< Type >::z.
References CL_Vec3< Type >::x, CL_Vec3< Type >::y, and CL_Vec3< Type >::z.
References CL_Vec3< Type >::x, CL_Vec3< Type >::y, and CL_Vec3< Type >::z.
References CL_Vec3< Type >::x, CL_Vec3< Type >::y, and CL_Vec3< Type >::z.
References CL_Vec3< Type >::x, CL_Vec3< Type >::y, and CL_Vec3< Type >::z.
References CL_Vec3< Type >::x, CL_Vec3< Type >::y, and CL_Vec3< Type >::z.
References CL_Vec3< Type >::x, CL_Vec3< Type >::y, and CL_Vec3< Type >::z.
References CL_Vec3< Type >::x, CL_Vec3< Type >::y, and CL_Vec3< Type >::z.
References CL_Vec3< Type >::x, CL_Vec3< Type >::y, and CL_Vec3< Type >::z.
References CL_Vec3< Type >::x, CL_Vec3< Type >::y, and CL_Vec3< Type >::z.
Calculate the angle between this vector and an other vector.
vector | Second vector used to calculate angle. |
|
static |
Calculate the cross product between two vectors.
vector1 | = The first vector |
vector2 | = The second vector |
Calculate the cross product between this vector and an other vector.
Operates in the native datatype
vector | = Second vector used to perform the calculation. |
Calculate the distance between this vector and an other vector.
vector | = Second vector used to calculate distance. |
|
inlinestatic |
Dot products between two vectors.
Dot products this vector with an other vector.
Operates in the native datatype
vector | Second vector used for the dot product. |
Type CL_Vec3< Type >::length | ( | ) | const |
Returns the length (magnitude) of this vector.
Operates in the native datatype
|
static |
Normalizes a vector.
vector | = Vector to use |
Operates in the native datatype
Normalizes this vector.
Operates in the native datatype
|
inline |
|
inline |
|
inline |
!= operator.
|
inline |
*= operator.
|
inline |
*= operator.
|
inline |
+= operator.
|
inline |
+= operator.
|
inline |
-= operator.
|
inline |
-= operator.
|
inline |
/ operator.
/ operator.
/= operator.
|
inline |
/= operator.
|
inline |
= operator.
|
inline |
== operator.
|
inline |
|
inline |
|
static |
Rotate a vector around an axis. Same as glRotate[f|d](angle, a);.
vector | = Vector to use |
angle | = Angle to rotate. |
axis | = Rotation axis. |
CL_Vec3<Type>& CL_Vec3< Type >::rotate | ( | const CL_Angle & | angle, |
const CL_Vec3< Type > & | axis | ||
) |
Rotate this vector around an axis. Same as glRotate[f|d](angle, a);.
angle | Angle to rotate. |
axis | Rotation axis. |
|
static |
Rounds all components on a vector.
Uses Asymmetric Arithmetic Rounding
vector | = Vector to use |
Rounds all components on this vector.
Uses Asymmetric Arithmetic Rounding
union { ... } |
union { ... } |
union { ... } |
Type CL_Vec3< Type >::b |
Type CL_Vec3< Type >::g |
Type CL_Vec3< Type >::r |
Type CL_Vec3< Type >::s |
Type CL_Vec3< Type >::t |
Type CL_Vec3< Type >::u |
Type CL_Vec3< Type >::x |
Referenced by CL_Vec1< Type >::CL_Vec1(), CL_Vec2< int >::CL_Vec2(), CL_Vec3< int >::CL_Vec3(), CL_Vec3< float >::CL_Vec3(), CL_Vec3< double >::CL_Vec3(), CL_Vec3< Type >::CL_Vec3(), CL_Vec4< Type >::CL_Vec4(), CL_Vec3< int >::dot(), CL_Vec3< int >::operator!=(), CL_Vec3< int >::operator*(), operator*(), CL_Vec3< int >::operator*=(), CL_Vec3< int >::operator+(), CL_Vec3< int >::operator+=(), CL_Vec3< int >::operator-(), CL_Vec3< int >::operator-=(), CL_Vec3< int >::operator/(), CL_Vec3< int >::operator/=(), CL_Vec3< int >::operator=(), CL_Vec3< int >::operator==(), CL_ProgramObject::set_uniform3b(), CL_ProgramObject::set_uniform3f(), CL_ProgramObject::set_uniform3i(), and CL_ProgramObject::set_uniform3s().
Type CL_Vec3< Type >::y |
Referenced by CL_Vec2< int >::CL_Vec2(), CL_Vec3< int >::CL_Vec3(), CL_Vec3< float >::CL_Vec3(), CL_Vec3< double >::CL_Vec3(), CL_Vec3< Type >::CL_Vec3(), CL_Vec4< Type >::CL_Vec4(), CL_Vec3< int >::dot(), CL_Vec3< int >::operator!=(), CL_Vec3< int >::operator*(), operator*(), CL_Vec3< int >::operator*=(), CL_Vec3< int >::operator+(), CL_Vec3< int >::operator+=(), CL_Vec3< int >::operator-(), CL_Vec3< int >::operator-=(), CL_Vec3< int >::operator/(), CL_Vec3< int >::operator/=(), CL_Vec3< int >::operator=(), CL_Vec3< int >::operator==(), CL_ProgramObject::set_uniform3b(), CL_ProgramObject::set_uniform3f(), CL_ProgramObject::set_uniform3i(), and CL_ProgramObject::set_uniform3s().
Type CL_Vec3< Type >::z |
Referenced by CL_Vec3< int >::CL_Vec3(), CL_Vec3< float >::CL_Vec3(), CL_Vec3< double >::CL_Vec3(), CL_Vec3< Type >::CL_Vec3(), CL_Vec4< Type >::CL_Vec4(), CL_Vec3< int >::dot(), CL_Vec3< int >::operator!=(), CL_Vec3< int >::operator*(), operator*(), CL_Vec3< int >::operator*=(), CL_Vec3< int >::operator+(), CL_Vec3< int >::operator+=(), CL_Vec3< int >::operator-(), CL_Vec3< int >::operator-=(), CL_Vec3< int >::operator/(), CL_Vec3< int >::operator/=(), CL_Vec3< int >::operator=(), CL_Vec3< int >::operator==(), CL_ProgramObject::set_uniform3b(), CL_ProgramObject::set_uniform3f(), CL_ProgramObject::set_uniform3i(), and CL_ProgramObject::set_uniform3s().