#include <Vector3D.hpp>
Public Member Functions | |
Vector3D () | |
Vector3D (const T &_xxx, const T &_yyy, const T &_zzz) | |
Vector3D< T > & | operator+= (const Vector3D< T > &_obj) |
Vector3D< T > | operator+ (const Vector3D< T > &_obj) |
Vector3D< T > & | operator-= (const Vector3D< T > &_obj) |
Vector3D< T > | operator- (const Vector3D< T > &_obj) |
Vector3D< T > & | operator*= (const T &_val) |
Vector3D< T > | operator* (const T &_val) |
Vector3D< T > & | operator/= (const Vector3D< T > &_val) |
Vector3D< T > & | operator/= (const T &_val) |
float | dot (const Vector3D< T > &_obj) const |
float | length2 () const |
float | length () const |
float | distance2 (const Vector3D< T > &_obj) const |
float | distance (const Vector3D< T > &_obj) const |
Vector3D< T > & | safeNormalize () |
Vector3D< T > & | normalize () |
Vector3D< T > | normalized () const |
Vector3D< T > | rotate (const Vector3D< T > &_wAxis, const float _angle) const |
float | angle (const Vector3D< T > &_obj) const |
Vector3D< T > | absolute () const |
Vector3D< T > | cross (const Vector3D< T > &_obj) const |
T | triple (const Vector3D< T > &_obj1, const Vector3D< T > &_obj2) const |
int32_t | minAxis () const |
int32_t | maxAxis () const |
int32_t | furthestAxis () const |
int32_t | closestAxis () const |
void | setInterpolate3 (const Vector3D< T > &_obj0, const Vector3D< T > &_obj1, T _ratio) |
Vector3D< T > | lerp (const Vector3D< T > &_obj, const float &_ratio) const |
Vector3D< T > & | operator*= (const Vector3D< T > &_obj) |
Vector3D< T > | operator* (const Vector3D< T > &_obj) |
const T & | getX () const |
const T & | getY () const |
const T & | getZ () const |
void | setX (T _x) |
void | setY (T _y) |
void | setZ (T _z) |
const T & | x () const |
const T & | y () const |
const T & | z () const |
operator T* () | |
operator const T * () const | |
bool | operator== (const Vector3D< T > &_obj) const |
bool | operator!= (const Vector3D< T > &_obj) const |
void | setMax (const Vector3D< T > &_obj) |
void | setMin (const Vector3D< T > &_obj) |
void | setValue (const T &_xxx, const T &_yyy, const T &_zzz) |
void | getSkewSymmetricMatrix (Vector3D< T > *_obj0, Vector3D< T > *_obj1, Vector3D< T > *_obj2) const |
void | setZero () |
bool | isZero () const |
Public Attributes | |
T | m_floats [4] |
Detailed Description
template<typename T>
class etk::Vector3D< T >
Vectorial 3-dimention vector (x/y/z)
Constructor & Destructor Documentation
§ Vector3D() [1/2]
|
inline |
No initialization constructor (faster ...)
§ Vector3D() [2/2]
|
inline |
Constructor from scalars.
- Parameters
-
[in] _xxx X value [in] _yyy Y value [in] _zzz Z value
Member Function Documentation
§ absolute()
|
inline |
Return a vector will the absolute values of each element.
- Returns
- New vector containing the value
§ angle()
|
inline |
Calculate the angle between this and another vector.
- Parameters
-
[in] _obj The other vector
- Returns
- Angle in radian
§ closestAxis()
|
inline |
Return the axis with the largest ABSOLUTE value.
- Returns
- values 0,1,2 for x, y, or z
§ cross()
|
inline |
Return the cross product between this and another vector.
- Parameters
-
[in] _obj The other vector
- Returns
- Vector with the result of the cross product
§ 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
-
[in] _obj The other vector in the dot product
- Returns
- Dot product value
§ furthestAxis()
|
inline |
Return the axis with the smallest ABSOLUTE value.
- Returns
- values 0,1,2 for x, y, or z
§ getSkewSymmetricMatrix()
|
inline |
Create a skew matrix of the object.
- Parameters
-
[out] _obj0 Vector matric first line [out] _obj1 Vector matric second line [out] _obj2 Vector matric third line
§ 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)
- Returns
- true The value is equal to (0,0,0)
- false The value is NOT equal to (0,0,0)
§ length()
|
inline |
Get the length of the vector.
- Returns
- Length value
§ length2()
|
inline |
Get the length of the vector squared.
- Returns
- Squared length value.
§ lerp()
|
inline |
Return the linear interpolation between this and another vector.
- Parameters
-
[in] _obj The other vector [in] _ratio The ratio of this to _obj (_ratio = 0 => return copy of this, _ratio=1 => return other)
- Returns
- New vector containing the value
§ maxAxis()
|
inline |
Return the axis with the largest value.
- Returns
- values 0,1,2 for x, y, or z
§ minAxis()
|
inline |
Return the axis with the smallest value.
- Returns
- values 0,1,2 for x, y, or z
§ normalize()
|
inline |
Normalize this vector x^2 + y^2 + z^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 |
Elementwise 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 |
Elementwise multiply this vector by the other.
- Parameters
-
_obj The other vector
- Returns
- Local reference of the vector normalized
§ 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
-
[in] _obj The vector to subtract
- Returns
- New vector containing the value
§ operator-=()
|
inline |
Subtract a vector from this one.
- Parameters
-
[in] _obj The vector to subtract
- Returns
- Local reference of the vector
§ operator/=() [1/2]
|
inline |
Inversely scale the vector.
- Parameters
-
[in] _val Scale factor to divide by
- Returns
- Local reference of the vector
§ operator/=() [2/2]
|
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
§ rotate()
|
inline |
Return a rotated version of this vector.
- Parameters
-
[in] _wAxis The axis to rotate about [in] _angle The angle to rotate by
- Returns
- New vector containing the value
§ safeNormalize()
|
inline |
Normalize this vector x^2 + y^2 + z^2 = 1 (check if not deviding by 0, if it is the case ==> return (1,0,0))
- Returns
- Local reference of the vector normalized
§ setInterpolate3()
|
inline |
Interpolate the vector with a ration between 2 others.
- Parameters
-
[in] _obj0 First vector [in] _obj1 Second vector [in] _ratio Ratio between _obj0 and _obj1
§ setMax()
|
inline |
Set each element to the max of the current values and the values of another Vector3D<T>
- Parameters
-
_obj The other Vector3D<T> to compare with
§ setMin()
|
inline |
Set each element to the min of the current values and the values of another Vector3D<T>
- Parameters
-
_obj The other Vector3D<T> to compare with
§ setValue()
|
inline |
Set Value on the vector.
- Parameters
-
[in] _xxx X value. [in] _yyy Y value. [in] _zzz Z 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.
§ triple()
|
inline |
Return the triple product between this and another vector and another.
- Parameters
-
[in] _obj1 The other vector 1 [in] _obj2 The other vector 2
- Returns
- Value with the result of the triple product
§ 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::Vector3D< T >::m_floats[4] |
all internal values
The documentation for this class was generated from the following file:
- framework/atria-soft/etk/etk/math/Vector3D.hpp