#include <Vector4D.hpp>
Public Member Functions | |
Vector4D () | |
Vector4D (const T &_xxx, const T &_yyy, const T &_zzz, const T &_www) | |
Vector4D< T > & | operator+= (const Vector4D< T > &_obj) |
Vector4D< T > | operator+ (const Vector4D< T > &_obj) |
Vector4D< T > & | operator-= (const Vector4D< T > &_obj) |
Vector4D< T > | operator- (const Vector4D< T > &_obj) |
Vector4D< T > & | operator*= (const T &_val) |
Vector4D< T > | operator* (const T &_val) |
Vector4D< T > & | operator/= (const T &_val) |
Vector4D< T > | operator/ (const T &_val) |
float | dot (const Vector4D< T > &_obj) const |
float | length2 () const |
float | length () const |
float | distance2 (const Vector4D< T > &_obj) const |
float | distance (const Vector4D< T > &_obj) const |
Vector4D< T > & | normalize () |
Vector4D< T > | normalized () const |
Vector4D< T > | absolute () const |
Vector4D< T > & | operator*= (const Vector4D< T > &_obj) |
Vector4D< T > | operator* (const Vector4D< T > &_obj) |
const T & | getX () const |
const T & | getY () const |
const T & | getZ () const |
const T & | getW () const |
void | setX (T _x) |
void | setY (T _y) |
void | setZ (T _z) |
void | setW (T _w) |
const T & | x () const |
const T & | y () const |
const T & | z () const |
const T & | w () const |
operator T* () | |
operator const T * () const | |
bool | operator== (const Vector4D< T > &_obj) const |
bool | operator!= (const Vector4D< T > &_obj) const |
void | setMax (const Vector4D< T > &_obj) |
void | setMin (const Vector4D< T > &_obj) |
void | setValue (const T &_xxx, const T &_yyy, const T &_zzz, const T &_www) |
void | setZero () |
bool | isZero () const |
Public Attributes | |
T | m_floats [4] |
Detailed Description
template<typename T>
class etk::Vector4D< T >
Vectorial 4-dimention vector (x/y/z/w)
Constructor & Destructor Documentation
§ Vector4D() [1/2]
|
inline |
No initialization constructor (faster ...)
§ Vector4D() [2/2]
|
inline |
Constructor from scalars.
- Parameters
-
_xxx X value _yyy Y value _zzz Z value _www W value
Member Function Documentation
§ absolute()
|
inline |
Return a vector will the absolute values of each element.
- Returns
- New vector with the absolute value
§ distance()
|
inline |
Return the distance between the ends of this and another vector This is symantically treating the vector like a point.
- Parameters
-
[in] _obj The other vector to compare distance
- Returns
- the distance of the 2 points
§ distance2()
|
inline |
Return the distance squared between the ends of this and another vector This is symantically treating the vector like a point.
- Parameters
-
[in] _obj The other vector to compare distance
- Returns
- the square distance of the 2 points
§ dot()
|
inline |
Return the dot product.
- Parameters
-
_obj The other vector in the dot product
- Returns
- Dot result value
§ getW()
|
inline |
Get W value.
- Returns
- the w value
§ getX()
|
inline |
Get X value.
- Returns
- the x value
§ getY()
|
inline |
Get Y value.
- Returns
- the y value
§ getZ()
|
inline |
Get Z value.
- Returns
- the z value
§ isZero()
|
inline |
Check if the vector is equal to (0,0,0,0)
- Returns
- true The value is equal to (0,0,0,0)
- false The value is NOT equal to (0,0,0,0)
§ length()
|
inline |
Return the length of the vector.
- Returns
- Length value
§ length2()
|
inline |
Return the squared length of the vector.
- Returns
- Squared length value.
§ normalize()
|
inline |
Normalize this vector x^2 + y^2 + z^2 + w^2 = 1.
- Returns
- Local reference of the vector normalized
§ normalized()
|
inline |
Return a normalized version of this vector.
- Returns
- New vector containing the value
§ operator const T *()
|
inline |
Cast the vector in the type const T* requested.
- Returns
- Pointer on the const data
§ operator T*()
|
inline |
Cast the vector in the type T* requested.
- Returns
- Pointer on the data
§ operator!=()
|
inline |
In-Equality compare operator with an other object.
- Parameters
-
[in] _obj Reference on the comparing object
- Returns
- true The Objects are NOT identical
- false The Objects are identical
§ operator*() [1/2]
|
inline |
Scale the vector.
- Parameters
-
[in] _val Scale factor
- Returns
- New vector containing the value
§ operator*() [2/2]
|
inline |
Multiply this vector by the other.
- Parameters
-
_obj The other vector
- Returns
- New vector containing the value
§ operator*=() [1/2]
|
inline |
Scale the vector.
- Parameters
-
[in] _val Scale factor
- Returns
- Local reference of the vector
§ operator*=() [2/2]
|
inline |
Multiply this vector by the other.
- Parameters
-
_obj The other vector
- Returns
- Local reference of the vector
§ operator+()
|
inline |
Add a vector to this one.
- Parameters
-
[in] _obj The vector to add to this one
- Returns
- New vector containing the value
§ operator+=()
|
inline |
Add a vector to this one.
- Parameters
-
[in] _obj The vector to add to this one
- Returns
- Local reference of the vector
§ operator-()
|
inline |
Subtract a vector from this one.
- Parameters
-
_obj The vector to subtract
- Returns
- New vector containing the value
§ operator-=()
|
inline |
Subtract a vector from this one.
- Parameters
-
_obj The vector to subtract
- Returns
- Local reference of the vector
§ operator/()
|
inline |
Inversely scale the vector.
- Parameters
-
[in] _val Scale factor to divide by.
- Returns
- New vector containing the value
§ operator/=()
|
inline |
Inversely scale the vector.
- Parameters
-
[in] _val Scale factor to divide by.
- Returns
- Local reference of the vector
§ operator==()
|
inline |
Equality compare operator with an other object.
- Parameters
-
[in] _obj Reference on the comparing object
- Returns
- true The Objects are identical
- false The Objects are NOT identical
§ setMax()
|
inline |
Set each element to the max of the current values and the values of another Vector.
- Parameters
-
_obj The other Vector to compare with
§ setMin()
|
inline |
Set each element to the min of the current values and the values of another Vector.
- Parameters
-
_obj The other Vector to compare with
§ setValue()
|
inline |
Set Value on the vector.
- Parameters
-
[in] _xxx X value. [in] _yyy Y value. [in] _zzz Z value. [in] _www W value.
§ setW()
|
inline |
Set the w value.
- Parameters
-
[in] _w New value
§ setX()
|
inline |
Set the x value.
- Parameters
-
[in] _x New value
§ setY()
|
inline |
Set the y value.
- Parameters
-
[in] _y New value
§ setZ()
|
inline |
Set the z value.
- Parameters
-
[in] _z New value
§ setZero()
|
inline |
Set 0 value on all the vector.
§ w()
|
inline |
Get W value.
- Returns
- the w value
§ x()
|
inline |
Get X value.
- Returns
- the x value
§ y()
|
inline |
Get Y value.
- Returns
- the y value
§ z()
|
inline |
Get Z value.
- Returns
- the z value
Member Data Documentation
§ m_floats
T etk::Vector4D< T >::m_floats[4] |
all internal values
The documentation for this class was generated from the following file:
- framework/atria-soft/etk/etk/math/Vector4D.hpp