#include <Vector2D.hpp>
| Public Member Functions | |
| Vector2D (T _xxx, T _yyy) | |
| Vector2D (const Vector2D< double > &_obj) | |
| Vector2D (const Vector2D< float > &_obj) | |
| Vector2D (const Vector2D< int32_t > &_obj) | |
| Vector2D (const std::string &_str) | |
| const Vector2D< T > & | operator= (const Vector2D< T > &_obj) | 
| const Vector2D< T > & | operator= (const T _val) | 
| bool | operator== (const Vector2D< T > &_obj) const | 
| bool | operator!= (const Vector2D< T > &_obj) const | 
| const Vector2D< T > & | operator+= (const Vector2D< T > &_obj) | 
| const Vector2D< T > & | operator+= (const T _val) | 
| Vector2D< T > | operator+ (const Vector2D< T > &_obj) const | 
| Vector2D< T > | operator+ (const T _val) const | 
| const Vector2D< T > & | operator-= (const Vector2D< T > &_obj) | 
| const Vector2D< T > & | operator-= (const T _val) | 
| Vector2D< T > | operator- (const Vector2D< T > &_obj) const | 
| Vector2D< T > | operator- (const T _val) const | 
| const Vector2D< T > & | operator*= (const Vector2D< T > &_obj) | 
| const Vector2D< T > & | operator*= (const T _val) | 
| Vector2D< T > | operator* (const Vector2D< T > &_obj) const | 
| Vector2D< T > | operator* (const T _val) const | 
| Vector2D< T > | operator/ (const Vector2D< T > &_obj) const | 
| Vector2D< T > | operator/ (const T _val) const | 
| const Vector2D< T > & | operator/= (const Vector2D< T > &_obj) | 
| const Vector2D< T > & | operator/= (const T _val) | 
| Vector2D< T > & | operator++ () | 
| Vector2D< T > | operator++ (int) | 
| Vector2D< T > & | operator-- () | 
| Vector2D< T > | operator-- (int) | 
| T | cross (const Vector2D< T > &_obj) const | 
| T | dot (const Vector2D< T > &_obj) const | 
| T | length2 () const | 
| float | length () const | 
| T | distance2 (const Vector2D< T > &_obj) const | 
| float | distance (const Vector2D< T > &_obj) const | 
| Vector2D< T > & | normalize () | 
| Vector2D< T > & | safeNormalize () | 
| Vector2D< T > | normalized () const | 
| Vector2D< T > | absolute () const | 
| int32_t | minAxis () const | 
| int32_t | maxAxis () const | 
| int32_t | furthestAxis () const | 
| int32_t | closestAxis () const | 
| const T & | getX () const | 
| const T & | getY () const | 
| void | setX (T _xxx) | 
| void | setY (T _yyy) | 
| const T & | x () const | 
| const T & | y () const | 
| operator T* () | |
| operator const T * () const | |
| void | setMax (const Vector2D< T > &_other) | 
| void | setMin (const Vector2D< T > &_other) | 
| void | setValue (const T &_xxx, const T &_yyy) | 
| void | setZero () | 
| bool | isZero () const | 
| operator std::string () const | |
| Public Attributes | |
| T | m_floats [2] | 
Detailed Description
template<typename T>
class etk::Vector2D< T >
Vectorial 2-dimention vector (x/y)
Constructor & Destructor Documentation
§ Vector2D() [1/5]
| 
 | inline | 
Constructor from scalars.
- Parameters
- 
  [in] _xxx X value [in] _yyy Y value 
§ Vector2D() [2/5]
| 
 | inline | 
Constructor with external vector.
- Parameters
- 
  [in] _obj The vector to add to this one 
§ Vector2D() [3/5]
| 
 | inline | 
Constructor with external vector.
- Parameters
- 
  [in] _obj The vector to add to this one 
§ Vector2D() [4/5]
| 
 | inline | 
Constructor with external vector.
- Parameters
- 
  [in] _obj The vector to add to this one 
§ Vector2D() [5/5]
| etk::Vector2D< T >::Vector2D | ( | const std::string & | _str | ) | 
Constructor with string data.
- Parameters
- 
  [in] _str Sting containing the value to parse 
Member Function Documentation
§ absolute()
| 
 | inline | 
Return a vector will the absolute values of each element.
- Returns
- New vector containing the value
§ closestAxis()
| 
 | inline | 
Return the axis with the largest ABSOLUTE value.
- Returns
- values 0,1 for x or y
§ cross()
| 
 | inline | 
Return the cross product / determinant.
- Parameters
- 
  _obj The other vector in the cross product 
- Returns
- cross product 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 product value
§ furthestAxis()
| 
 | inline | 
Return the axis with the smallest ABSOLUTE value.
- Returns
- values 0,1 for x, or z
§ getX()
| 
 | inline | 
Get X value.
- Returns
- the x value
§ getY()
| 
 | inline | 
Get Y value.
- Returns
- the y value
§ isZero()
| 
 | inline | 
Check if the vector is equal to (0,0)
- Returns
- true The value is equal to (0,0)
- false The value is NOT equal to (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.
§ maxAxis()
| 
 | inline | 
Return the axis with the largest value.
- Returns
- values are 0,1 for x or y
§ minAxis()
| 
 | inline | 
Return the axis with the smallest value.
- Returns
- values are 0,1 for x or y
§ normalize()
| 
 | inline | 
Normalize this vector x^2 + y^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 std::string()
| etk::Vector2D< T >::operator std::string | ( | ) | const | 
String caster of the object.
- Returns
- the Object cated in string (x.x,y.y)
§ 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 | 
Operator* Multiplication an other vertor with this one.
- Parameters
- 
  [in] _obj Reference on the external object 
- Returns
- New vector containing the value
§ operator*() [2/2]
| 
 | inline | 
Operator* Multiplication an other vertor with this one.
- Parameters
- 
  [in] _val Value to addition at x/y 
- Returns
- New vector containing the value
§ operator*=() [1/2]
| 
 | inline | 
Operator*= Multiplication an other vertor with this one.
- Parameters
- 
  [in] _obj Reference on the external object 
- Returns
- Local reference of the vector multiplicated
§ operator*=() [2/2]
| 
 | inline | 
Operator*= Multiplication an other vertor with this one.
- Parameters
- 
  [in] _val Value to addition at x/y 
- Returns
- Local reference of the vector multiplicated
§ operator+() [1/2]
| 
 | inline | 
Operator+ Addition an other vertor with this one.
- Parameters
- 
  [in] _obj Reference on the external object 
- Returns
- New vector containing the value
§ operator+() [2/2]
| 
 | inline | 
Operator+ Addition an other vertor with this one.
- Parameters
- 
  [in] _val Value to addition at x/y 
- Returns
- New vector containing the value
§ operator++() [1/2]
| 
 | inline | 
Operator++ Pre-incrementation of this vector.
- Returns
- Local reference of the vector incremented
§ operator++() [2/2]
| 
 | inline | 
Operator++ Post-incrementation of this vector.
- Returns
- New vector containing the last value
§ operator+=() [1/2]
| 
 | inline | 
Operator+= Addition an other vertor with this one.
- Parameters
- 
  [in] _obj Reference on the external object 
- Returns
- Local reference of the vector additionned
§ operator+=() [2/2]
| 
 | inline | 
Operator+= Addition an other vertor with this one.
- Parameters
- 
  [in] _val Value to addition at x/y 
- Returns
- Local reference of the vector additionned
§ operator-() [1/2]
| 
 | inline | 
Operator- Decrement an other vertor with this one.
- Parameters
- 
  [in] _obj Reference on the external object 
- Returns
- New vector containing the value
§ operator-() [2/2]
| 
 | inline | 
Operator- Decrement an other vertor with this one.
- Parameters
- 
  [in] _val Value to addition at x/y 
- Returns
- New vector containing the value
§ operator--() [1/2]
| 
 | inline | 
Operator++ Pre-decrementation of this vector.
- Returns
- Local reference of the vector incremented
§ operator--() [2/2]
| 
 | inline | 
Operator++ Post-decrementation of this vector.
- Returns
- New vector containing the last value
§ operator-=() [1/2]
| 
 | inline | 
Operator-= Decrement an other vertor with this one.
- Parameters
- 
  [in] _obj Reference on the external object 
- Returns
- Local reference of the vector decremented
§ operator-=() [2/2]
| 
 | inline | 
Operator-= Decrement an other vertor with this one.
- Parameters
- 
  [in] _val Value to addition at x/y 
- Returns
- Local reference of the vector decremented
§ operator/() [1/2]
| 
 | inline | 
Operator/= Dividing an other vertor with this one.
- Parameters
- 
  [in] _obj Reference on the external object 
- Returns
- Local reference of the vector divided
§ operator/() [2/2]
| 
 | inline | 
Operator/= Dividing an other vertor with this one.
- Parameters
- 
  [in] _val Value to addition at x/y 
- Returns
- Local reference of the vector divided
§ operator/=() [1/2]
| 
 | inline | 
Operator/ Dividing an other vertor with this one.
- Parameters
- 
  [in] _obj Reference on the external object 
- Returns
- New vector containing the value
§ operator/=() [2/2]
| 
 | inline | 
Operator/ Dividing an other vertor with this one.
- Parameters
- 
  [in] _val Value to addition at x/y 
- Returns
- New vector containing the value
§ operator=() [1/2]
| 
 | inline | 
Operator= Asign the current object with an other object.
- Parameters
- 
  [in] _obj Reference on the external object 
- Returns
- Local reference of the vector asigned
§ operator=() [2/2]
| 
 | inline | 
Operator= Asign the current object with a value.
- Parameters
- 
  [in] _val Value to assign on the object 
- Returns
- Local reference of the vector asigned
§ 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
§ safeNormalize()
| 
 | inline | 
Normalize this vector x^2 + y^2 = 1 (check if not deviding by 0, if it is the case ==> return (1,0))
- Returns
- Local reference of the vector normalized
§ setMax()
| 
 | inline | 
Set each element to the max of the current values and the values of another vector.
- Parameters
- 
  _other 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
- 
  _other The other vector to compare with 
§ setValue()
| 
 | inline | 
Set Value on the vector.
- Parameters
- 
  [in] _xxx X value. [in] _yyy Y value. 
§ setX()
| 
 | inline | 
Set the x value.
- Parameters
- 
  [in] _xxx New value 
§ setY()
| 
 | inline | 
Set the y value.
- Parameters
- 
  [in] _yyy New value 
§ setZero()
| 
 | inline | 
Set 0 value on all the vector.
§ x()
| 
 | inline | 
Get X value.
- Returns
- the x value
§ y()
| 
 | inline | 
Get Y value.
- Returns
- the y value
Member Data Documentation
§ m_floats
| T etk::Vector2D< T >::m_floats[2] | 
all internal values
The documentation for this class was generated from the following file:
- framework/atria-soft/etk/etk/math/Vector2D.hpp
 1.8.12
 1.8.12