#include <vmath.h>
Public Member Functions | |
Vector2 () | |
Vector2 (T nx, T ny) | |
Vector2< T > & | operator= (const Vector2< T > &rhs) |
T & | operator[] (int n) |
Vector2< T > | operator+ (const Vector2< T > &rhs) const |
Vector2< T > | operator- (const Vector2< T > &rhs) const |
Vector2< T > | operator * (const Vector2< T > &rhs) const |
Vector2< T > | operator/ (const Vector2< T > &rhs) const |
Vector2< T > & | operator+= (const Vector2< T > &rhs) |
Vector2< T > & | operator-= (const Vector2< T > &rhs) |
Vector2< T > & | operator *= (const Vector2< T > &rhs) |
Vector2< T > & | operator/= (const Vector2< T > &rhs) |
Vector2< T > | operator+ (T rhs) const |
Vector2< T > | operator- (T rhs) const |
Vector2< T > | operator * (T rhs) const |
Vector2< T > | operator/ (T rhs) const |
Vector2< T > & | operator+= (T rhs) |
Vector2< T > & | operator-= (T rhs) |
Vector2< T > & | operator *= (T rhs) |
Vector2< T > & | operator/= (T rhs) |
bool | operator== (const Vector2< T > &rhs) const |
bool | operator!= (const Vector2< T > &rhs) const |
T | length () |
void | normalize () |
T | lengthSq () |
Vector2< T > | lerp (T fact, const Vector2< T > &r) const |
operator T * () | |
operator const T * () const | |
Friends | |
std::ostream & | operator<< (std::ostream &lhs, const Vector2< T > &rhs) |
Creates and sets to (x,y)
nx | intial x-coordinate value | |
ny | intial y-coordinate value |
Copy operator
rhs | Right hand side argument of binary operator. |
T& Vector2< T >::operator[] | ( | int | n | ) | [inline] |
Array access operator
n | Array index |
Addition operator
rhs | Right hand side argument of binary operator. |
Substraction operator
rhs | Right hand side argument of binary operator. |
Multiplication operator
rhs | Right hand side argument of binary operator. |
Division operator
rhs | Right hand side argument of binary operator. |
Addition operator
rhs | Right hand side argument of binary operator. |
Substraction operator
rhs | Right hand side argument of binary operator. |
Multiplication operator
rhs | Right hand side argument of binary operator. |
Division operator
rhs | Right hand side argument of binary operator. |
Addition operator
rhs | Right hand side argument of binary operator. |
Substraction operator
rhs | Right hand side argument of binary operator. |
Multiplication operator
rhs | Right hand side argument of binary operator. |
Division operator
rhs | Right hand side argument of binary operator. |
Addition operator
rhs | Right hand side argument of binary operator. |
Substraction operator
rhs | Right hand side argument of binary operator. |
Multiplication operator
rhs | Right hand side argument of binary operator. |
Division operator
rhs | Right hand side argument of binary operator. |
Equality test operator
rhs | Right hand side argument of binary operator. |
Inequality test operator
rhs | Right hand side argument of binary operator. |
T Vector2< T >::length | ( | ) | [inline] |
Get lenght of vector.
void Vector2< T >::normalize | ( | ) | [inline] |
Normalize vector
T Vector2< T >::lengthSq | ( | ) | [inline] |
Linear interpolation of two vectors
fact | Factor of interpolation. For translation from positon of this vector to vector r, values of factor goes from 0.0 to 1.0. | |
r | Second Vector for interpolation |
Vector2< T >::operator T * | ( | ) | [inline] |
Conversion to pointer operator
Vector2< T >::operator const T * | ( | ) | const [inline] |
Conversion to pointer operator
std::ostream& operator<< | ( | std::ostream & | lhs, | |
const Vector2< T > & | rhs | |||
) | [friend] |
Output to stream operator
lhs | Left hand side argument of operator (commonly ostream instance). | |
rhs | Right hand side argument of operator. |
First element of vector, alias for S-coordinate. For textures notation.
Second element of vector, alias for T-coordinate. For textures notation.