Vector2D.hpp
Go to the documentation of this file.
553 // To siplify the writing of the code ==> this permit to have the same name with the glsl language...
Vector2D< T > & normalize()
Normalize this vector x^2 + y^2 = 1.
Definition: Vector2D.hpp:375
int32_t maxAxis() const
Return the axis with the largest value.
Definition: Vector2D.hpp:418
void setMin(const Vector2D< T > &_other)
Set each element to the min of the current values and the values of another vector.
Definition: Vector2D.hpp:503
Vector2D(T _xxx, T _yyy)
Constructor from scalars.
Definition: Vector2D.hpp:37
const Vector2D< T > & operator/=(const Vector2D< T > &_obj)
Operator/ Dividing an other vertor with this one.
Definition: Vector2D.hpp:266
float distance(const Vector2D< T > &_obj) const
Return the distance between the ends of this and another vector This is symantically treating the vec...
Definition: Vector2D.hpp:368
Vector2D< T > operator*(const Vector2D< T > &_obj) const
Operator* Multiplication an other vertor with this one.
Definition: Vector2D.hpp:222
Vector2D< T > operator-(const Vector2D< T > &_obj) const
Operator- Decrement an other vertor with this one.
Definition: Vector2D.hpp:180
Vector2D< T > & operator++()
Operator++ Pre-incrementation of this vector.
Definition: Vector2D.hpp:285
Vector2D< T > absolute() const
Return a vector will the absolute values of each element.
Definition: Vector2D.hpp:403
basic namespace of the etk library. (it might contain all the etk fuctions/class/structures without m...
Definition: Archive.hpp:16
T cross(const Vector2D< T > &_obj) const
Return the cross product / determinant.
Definition: Vector2D.hpp:322
Vector2D< T > normalized() const
Return a normalized version of this vector.
Definition: Vector2D.hpp:396
int32_t minAxis() const
Return the axis with the smallest value.
Definition: Vector2D.hpp:411
const Vector2D< T > & operator*=(const Vector2D< T > &_obj)
Operator*= Multiplication an other vertor with this one.
Definition: Vector2D.hpp:202
const Vector2D< T > & operator-=(const Vector2D< T > &_obj)
Operator-= Decrement an other vertor with this one.
Definition: Vector2D.hpp:160
vec2 vec2ClipInt64(const vec2 &_val)
Limit at integer value the input vector: vec3(1.2, -2.9) ==> vec3(1.0, -2.0)
Definition: Vector2D.hpp:573
vec2 vec2rotate(const vec2 &_obj, const vec2 &_point, float _angle)
Rotate the vector at a specific position with a specific angle.
const Vector2D< T > & operator+=(const Vector2D< T > &_obj)
Operator+= Addition an other vertor with this one.
Definition: Vector2D.hpp:118
Vector2D< T > operator/(const Vector2D< T > &_obj) const
Operator/= Dividing an other vertor with this one.
Definition: Vector2D.hpp:244
T dot(const Vector2D< T > &_obj) const
Return the dot product.
Definition: Vector2D.hpp:331
T distance2(const Vector2D< T > &_obj) const
Return the distance squared between the ends of this and another vector This is symantically treating...
Definition: Vector2D.hpp:359
bool operator!=(const Vector2D< T > &_obj) const
In-Equality compare operator with an other object.
Definition: Vector2D.hpp:109
int32_t furthestAxis() const
Return the axis with the smallest ABSOLUTE value.
Definition: Vector2D.hpp:425
Vector2D(const Vector2D< double > &_obj)
Constructor with external vector.
Definition: Vector2D.hpp:45
etk::Vector2D< float > vec2
wrapper on etk::Vector2D<float> to have the same naming has OpenGL shader
Definition: Vector2D.hpp:554
T length2() const
Get the length of the vector squared.
Definition: Vector2D.hpp:339
int32_t closestAxis() const
Return the axis with the largest ABSOLUTE value.
Definition: Vector2D.hpp:432
Vector2D< T > & operator--()
Operator++ Pre-decrementation of this vector.
Definition: Vector2D.hpp:303
bool isZero() const
Check if the vector is equal to (0,0)
Definition: Vector2D.hpp:527
Vector2D< T > operator--(int)
Operator++ Post-decrementation of this vector.
Definition: Vector2D.hpp:312
Vector2D(const Vector2D< int32_t > &_obj)
Constructor with external vector.
Definition: Vector2D.hpp:61
bool operator==(const Vector2D< T > &_obj) const
Equality compare operator with an other object.
Definition: Vector2D.hpp:99
Vector2D(const Vector2D< float > &_obj)
Constructor with external vector.
Definition: Vector2D.hpp:53
Vector2D< T > & safeNormalize()
Normalize this vector x^2 + y^2 = 1 (check if not deviding by 0, if it is the case ==> return (1...
Definition: Vector2D.hpp:383
Vector2D< T > operator+(const Vector2D< T > &_obj) const
Operator+ Addition an other vertor with this one.
Definition: Vector2D.hpp:138
Vector2D< T > operator++(int)
Operator++ Post-incrementation of this vector.
Definition: Vector2D.hpp:294
const Vector2D< T > & operator=(const Vector2D< T > &_obj)
Operator= Asign the current object with an other object.
Definition: Vector2D.hpp:78
void setValue(const T &_xxx, const T &_yyy)
Set Value on the vector.
Definition: Vector2D.hpp:512
void setMax(const Vector2D< T > &_other)
Set each element to the max of the current values and the values of another vector.
Definition: Vector2D.hpp:495
vec2 vec2ClipInt32(const vec2 &_val)
Limit at integer value the input vector: vec3(1.2, -2.9) ==> vec3(1.0, -2.0)
Definition: Vector2D.hpp:565