4D vector More...
#include <size.h>
Public Types | |
typedef Type | datatype |
Public Member Functions | |
Vec4 () | |
Vec4 (const Type &scalar) | |
Vec4 (const Vec2< Type > ©, const Type &p3, const Type &p4) | |
Vec4 (const Vec2< Type > ©, const Vec2< Type > ©34) | |
Vec4 (const Vec3< Type > ©, const Type &p4) | |
Vec4 (const Type &p1, const Type &p2, const Type &p3, const Type &p4) | |
Vec4 (const Type &p1, const Type &p2, const Vec2< Type > ©34) | |
Vec4 (const Type *array_xyzw) | |
Type | angle3 (const Vec4< Type > &vector) const |
Calculate the angle between this vector and an other vector (not taking into account the w ordinate). More... | |
Vec4< Type > & | cross3 (const Vec4< Type > &vector) |
Calculate the cross product between this vector and an other vector (not taking into account the w ordinate). More... | |
Type | distance3 (const Vec4< Type > &vector) const |
Calculate the distance between this vector and an other vector (not taking into account the w ordinate). More... | |
Type | distance4 (const Vec4< Type > &vector) const |
Calculate the distance between this vector and an other vector (taking into account the w ordinate). More... | |
Type | dot3 (const Vec4< Type > &vector) const |
Dot products this vector with an other vector (not taking into account the w ordinate). More... | |
Type | dot4 (const Vec4< Type > &vector) const |
Dot products this vector with an other vector (taking into account the w ordinate). More... | |
bool | is_equal (const Vec4< Type > &other, Type epsilon) const |
Returns true if equal within the bounds of an epsilon. More... | |
*Type | length3 () const |
Returns the length (magnitude) of this vector (not taking into account the w ordinate). More... | |
template<> | |
double | length3 () const |
template<> | |
float | length3 () const |
*Type | length4 () const |
Returns the length (magnitude) of this vector (taking into account the w ordinate). More... | |
template<> | |
double | length4 () const |
template<> | |
float | length4 () const |
Vec4< Type > & | normalize3 () |
Normalizes this vector (not taking into account the w ordinate) More... | |
Vec4< Type > & | normalize4 () |
Normalizes this vector (taking into account the w ordinate) More... | |
bool | operator!= (const Vec4< Type > &vector) const |
!= operator. More... | |
void | operator*= (const Vec4< Type > &vector) |
*= operator. More... | |
void | operator*= (Type value) |
*= operator. More... | |
void | operator+= (const Vec4< Type > &vector) |
+= operator. More... | |
void | operator+= (Type value) |
+= operator. More... | |
Vec4< Type > | operator- () const |
| |
void | operator-= (const Vec4< Type > &vector) |
-= operator. More... | |
void | operator-= (Type value) |
-= operator. More... | |
void | operator/= (const Vec4< Type > &vector) |
/= operator. More... | |
void | operator/= (Type value) |
/= operator. More... | |
bool | operator< (const Vec4< Type > &vector) const |
< operator. More... | |
Vec4< Type > & | operator= (const Vec4< Type > &vector) |
= operator. More... | |
bool | operator== (const Vec4< Type > &vector) const |
== operator. More... | |
Vec4< Type > & | rotate3 (Type angle, const Vec4< Type > &axis) |
Rotate this vector around an axis. Same as glRotate[f|d](angle, a);. More... | |
Vec4< Type > & | round () |
Rounds all components on this vector. More... | |
void | set_xy (const Vec2< Type > &new_v) |
void | set_zw (const Vec2< Type > &new_v) |
Static Public Member Functions | |
static Vec4< Type > | cross3 (const Vec4< Type > &vector1, const Vec4< Type > &vector2) |
Calculate the cross product between two vectors (not taking into account the w ordinate). More... | |
static Type | dot3 (const Vec4< Type > &vector1, const Vec4< Type > &vector2) |
Dot products between two vectors (not taking into account the w ordinate). More... | |
static Type | dot4 (const Vec4< Type > &vector1, const Vec4< Type > &vector2) |
Dot products between two vectors (taking into account the w ordinate). More... | |
static bool | is_equal (const Vec4< Type > &first, const Vec4< Type > &second, Type epsilon) |
Returns true if equal within the bounds of an epsilon. More... | |
static Vec4< Type > | normalize3 (const Vec4< Type > &vector) |
Normalizes a vector (not taking into account the w ordinate) More... | |
static Vec4< Type > | normalize4 (const Vec4< Type > &vector) |
Normalizes a vector (taking into account the w ordinate) More... | |
static Vec4< Type > | rotate3 (const Vec4< Type > &vector, Type angle, const Vec4< Type > &axis) |
Rotate a vector around an axis. Same as glRotate[f|d](angle, a);. More... | |
static Vec4< Type > | round (const Vec4< Type > &vector) |
Rounds all components on a vector. More... | |
Public Attributes | |
Type | w |
Type | x |
Type | y |
Type | z |
4D vector
These vector templates are defined for:
char (Vec4c), unsigned char (Vec4uc), short (Vec4s),
unsigned short (Vec4us), int (Vec4i), unsigned int (Vec4ui), float (Vec4f), double (Vec4d)
typedef Type uicore::Vec4< Type >::datatype |
|
inline |
|
inlineexplicit |
|
inlineexplicit |
|
inlineexplicit |
|
inlineexplicit |
|
inlineexplicit |
|
inlineexplicit |
|
inlineexplicit |
Type uicore::Vec4< Type >::angle3 | ( | const Vec4< Type > & | vector | ) | const |
Calculate the angle between this vector and an other vector (not taking into account the w ordinate).
vector | = Second vector used to calculate angle. |
|
static |
Calculate the cross product between two vectors (not taking into account the w ordinate).
= The first vector = The second vector
Vec4<Type>& uicore::Vec4< Type >::cross3 | ( | const Vec4< Type > & | vector | ) |
Calculate the cross product between this vector and an other vector (not taking into account the w ordinate).
Operates in the native datatype
vector | Second vector used to perform the calculation. |
Type uicore::Vec4< Type >::distance3 | ( | const Vec4< Type > & | vector | ) | const |
Calculate the distance between this vector and an other vector (not taking into account the w ordinate).
vector | = Second vector used to calculate distance. |
Type uicore::Vec4< Type >::distance4 | ( | const Vec4< Type > & | vector | ) | const |
Calculate the distance between this vector and an other vector (taking into account the w ordinate).
vector | = Second vector used to calculate distance. |
|
inlinestatic |
Dot products between two vectors (not taking into account the w ordinate).
Operates in the native datatype
vector1 | First vector used for the dot product. |
vector2 | Second vector used for the dot product. |
|
inline |
Dot products this vector with an other vector (not taking into account the w ordinate).
Operates in the native datatype
vector | Second vector used for the dot product. |
|
inlinestatic |
Dot products between two vectors (taking into account the w ordinate).
Operates in the native datatype
vector1 | First vector used for the dot product. |
vector2 | Second vector used for the dot product. |
|
inline |
Dot products this vector with an other vector (taking into account the w ordinate).
Operates in the native datatype
vector | Second vector used for the dot product. |
|
inlinestatic |
Returns true if equal within the bounds of an epsilon.
first | = Value A |
second | = Value B |
epsilon | = The epsilon (eg FLT_EPSILON/2, DBL_EPSILON/2) |
Referenced by uicore::Vec4< float >::is_equal().
|
inline |
Returns true if equal within the bounds of an epsilon.
other | = Other value |
epsilon | = The epsilon (eg FLT_EPSILON/2, DBL_EPSILON/2) |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
static |
Normalizes a vector (not taking into account the w ordinate)
Operates in the native datatype
vector | = The vector to use |
Vec4<Type>& uicore::Vec4< Type >::normalize3 | ( | ) |
Normalizes this vector (not taking into account the w ordinate)
Operates in the native datatype
|
static |
Normalizes a vector (taking into account the w ordinate)
Operates in the native datatype
vector | = The vector to use |
Vec4<Type>& uicore::Vec4< Type >::normalize4 | ( | ) |
Normalizes this vector (taking into account the w ordinate)
Operates in the native datatype
|
inline |
!= operator.
|
inline |
*= operator.
|
inline |
*= operator.
|
inline |
+= operator.
|
inline |
+= operator.
|
inline |
|
inline |
-= operator.
|
inline |
-= operator.
|
inline |
/= operator.
|
inline |
/= operator.
|
inline |
< operator.
|
inline |
= operator.
|
inline |
== operator.
|
static |
Rotate a vector around an axis. Same as glRotate[f|d](angle, a);.
Not taking into account the w ordinate
The w ordinate is not modified
vector | = The vector to use |
angle | Angle to rotate |
axis | Rotation axis. |
Vec4<Type>& uicore::Vec4< Type >::rotate3 | ( | Type | angle, |
const Vec4< Type > & | axis | ||
) |
Rotate this vector around an axis. Same as glRotate[f|d](angle, a);.
Not taking into account the w ordinate
The w ordinate is not modified
angle | Angle to rotate |
axis | Rotation axis. |
|
static |
Rounds all components on a vector.
Includes the w ordinate
Uses Asymmetric Arithmetic Rounding
vector | = The vector to use |
Vec4<Type>& uicore::Vec4< Type >::round | ( | ) |
Rounds all components on this vector.
Includes the w ordinate
Uses Asymmetric Arithmetic Rounding
|
inline |
|
inline |
Type uicore::Vec4< Type >::w |
Referenced by uicore::degrees(), uicore::StyleGetValue::from_color(), uicore::Color::get_abgr8(), uicore::Color::get_alpha(), uicore::Colorf::get_alpha(), uicore::Color::get_alpha_f(), uicore::Color::get_argb8(), uicore::Color::get_bgra8(), uicore::Color::get_rgba8(), uicore::max(), uicore::min(), uicore::Colorf::normalize(), uicore::normalize_180(), uicore::normalize_2pi(), uicore::normalize_360(), uicore::normalize_pi(), uicore::Color::operator!=(), uicore::Colorf::operator!=(), uicore::Vec4< float >::operator-(), uicore::Color::operator==(), uicore::Colorf::operator==(), uicore::radians(), uicore::Color::set_alpha(), uicore::Colorf::set_alpha(), uicore::Color::set_alpha_f(), uicore::Image::set_color(), uicore::Color::set_color(), uicore::Color::set_colorf(), uicore::ProgramObject::set_uniform4b(), uicore::ProgramObject::set_uniform4f(), uicore::ProgramObject::set_uniform4i(), uicore::ProgramObject::set_uniform4s(), uicore::sign(), uicore::step(), and uicore::Style::to_rgba().
Type uicore::Vec4< Type >::x |
Referenced by uicore::degrees(), uicore::StyleGetValue::from_color(), uicore::Color::get_abgr8(), uicore::Color::get_argb8(), uicore::Color::get_bgra8(), uicore::Color::get_red(), uicore::Colorf::get_red(), uicore::Color::get_red_f(), uicore::Color::get_rgba8(), uicore::max(), uicore::min(), uicore::Colorf::normalize(), uicore::normalize_180(), uicore::normalize_2pi(), uicore::normalize_360(), uicore::normalize_pi(), uicore::Color::operator!=(), uicore::Colorf::operator!=(), uicore::Vec4< float >::operator-(), uicore::Color::operator==(), uicore::Colorf::operator==(), uicore::radians(), uicore::Image::set_color(), uicore::Color::set_color(), uicore::Color::set_colorf(), uicore::Color::set_red(), uicore::Colorf::set_red(), uicore::Color::set_red_f(), uicore::ProgramObject::set_uniform4b(), uicore::ProgramObject::set_uniform4f(), uicore::ProgramObject::set_uniform4i(), uicore::ProgramObject::set_uniform4s(), uicore::ProgramObject::set_uniformfv(), uicore::ProgramObject::set_uniformiv(), uicore::sign(), uicore::step(), uicore::Style::to_rgba(), uicore::Vec2< int >::Vec2(), and uicore::Vec3< int >::Vec3().
Type uicore::Vec4< Type >::y |
Referenced by uicore::degrees(), uicore::StyleGetValue::from_color(), uicore::Color::get_abgr8(), uicore::Color::get_argb8(), uicore::Color::get_bgra8(), uicore::Color::get_green(), uicore::Colorf::get_green(), uicore::Color::get_green_f(), uicore::Color::get_rgba8(), uicore::max(), uicore::min(), uicore::Colorf::normalize(), uicore::normalize_180(), uicore::normalize_2pi(), uicore::normalize_360(), uicore::normalize_pi(), uicore::Color::operator!=(), uicore::Colorf::operator!=(), uicore::Vec4< float >::operator-(), uicore::Color::operator==(), uicore::Colorf::operator==(), uicore::radians(), uicore::Image::set_color(), uicore::Color::set_color(), uicore::Color::set_colorf(), uicore::Color::set_green(), uicore::Colorf::set_green(), uicore::Color::set_green_f(), uicore::ProgramObject::set_uniform4b(), uicore::ProgramObject::set_uniform4f(), uicore::ProgramObject::set_uniform4i(), uicore::ProgramObject::set_uniform4s(), uicore::sign(), uicore::step(), uicore::Style::to_rgba(), uicore::Vec2< int >::Vec2(), and uicore::Vec3< int >::Vec3().
Type uicore::Vec4< Type >::z |
Referenced by uicore::degrees(), uicore::StyleGetValue::from_color(), uicore::Color::get_abgr8(), uicore::Color::get_argb8(), uicore::Color::get_bgra8(), uicore::Color::get_blue(), uicore::Colorf::get_blue(), uicore::Color::get_blue_f(), uicore::Color::get_rgba8(), uicore::max(), uicore::min(), uicore::Colorf::normalize(), uicore::normalize_180(), uicore::normalize_2pi(), uicore::normalize_360(), uicore::normalize_pi(), uicore::Color::operator!=(), uicore::Colorf::operator!=(), uicore::Vec4< float >::operator-(), uicore::Color::operator==(), uicore::Colorf::operator==(), uicore::radians(), uicore::Color::set_blue(), uicore::Colorf::set_blue(), uicore::Color::set_blue_f(), uicore::Image::set_color(), uicore::Color::set_color(), uicore::Color::set_colorf(), uicore::ProgramObject::set_uniform4b(), uicore::ProgramObject::set_uniform4f(), uicore::ProgramObject::set_uniform4i(), uicore::ProgramObject::set_uniform4s(), uicore::sign(), uicore::step(), uicore::Style::to_rgba(), and uicore::Vec3< int >::Vec3().