#include <glfxvec.h>
Public Member Functions | |
| Vec2 (const float *v) | |
| Vec2 (const Vec2 &v) | |
| Vec2 (float x, float y) | |
| Vec2 (float f) | |
| operator float * () | |
| operator const float * () const | |
| operator Vec3 () const | |
| operator Vec4 () const | |
| float & | operator[] (int n) |
| Vec2 & | operator= (const Vec2 &v) |
| Vec2 & | operator *= (const Vec2 &v) |
| Vec2 & | operator/= (const Vec2 &v) |
| Vec2 & | operator+= (const Vec2 &v) |
| Vec2 & | operator-= (const Vec2 &v) |
| Vec2 & | Normalize () |
| float | Length () const |
| bool | Equal (const Vec2 &v) const |
| bool | NotEqual (const Vec2 &v) const |
Public Attributes | |
| float | x |
| float | y |
Friends | |
| Vec2 | operator * (const Vec2 &a, const Vec2 &b) |
| Vec2 | operator/ (const Vec2 &a, const Vec2 &b) |
| Vec2 | operator+ (const Vec2 &a, const Vec2 &b) |
| Vec2 | operator+ (const Vec2 &v) |
| Vec2 | operator- (const Vec2 &a, const Vec2 &b) |
| Vec2 | operator- (const Vec2 &v) |
| bool | operator== (const Vec2 &a, const Vec2 &b) |
| bool | operator!= (const Vec2 &a, const Vec2 &b) |
| Vec2 | Perpendicular (const Vec2 &v) |
| float | Dot (const Vec2 &a, const Vec2 &b) |
| Vec2 | Normalize (const Vec2 &v) |
| Vec2 | Lerp (const Vec2 &a, const Vec2 &b, float f) |
| float | Length (const Vec2 &a) |
| GLFX::Vec2::Vec2 | ( | const float * | v | ) | [inline] |
Construct vector from array of floats.
| GLFX::Vec2::Vec2 | ( | const Vec2 & | v | ) | [inline] |
Construct vector from another one.
| GLFX::Vec2::Vec2 | ( | float | x, | |
| float | y | |||
| ) | [inline] |
Construct vector from two scalars.
| GLFX::Vec2::Vec2 | ( | float | f | ) | [inline] |
Construct vector from scalar.
| GLFX::Vec2::operator float * | ( | ) | [inline] |
Convert to array of floats.
| GLFX::Vec2::operator const float * | ( | ) | const [inline] |
Convert to array of floats.
| GLFX::Vec2::operator Vec3 | ( | ) | const [inline] |
Convert to 3d vector.
| GLFX::Vec2::operator Vec4 | ( | ) | const [inline] |
Convert to 4d vector.
| float & GLFX::Vec2::operator[] | ( | int | n | ) | [inline] |
Get vector element.
| Vec2 & GLFX::Vec2::Normalize | ( | ) | [inline] |
Normalize vector. Not safe for zero-length vectors (division by zero).
| float GLFX::Vec2::Length | ( | ) | const [inline] |
Compute vector length.
| bool GLFX::Vec2::Equal | ( | const Vec2 & | v | ) | const [inline] |
Test if (thick) vectors are equal.
| bool GLFX::Vec2::NotEqual | ( | const Vec2 & | v | ) | const [inline] |
Test if (thick) vectors are not equal.
| float Length | ( | const Vec2 & | a | ) | [friend] |
Compute vector length.
| float GLFX::Vec2::x |
X-coordinate.
| float GLFX::Vec2::y |
Y-coordinate.