#include <core_math.h>
Public Member Functions | |
| vector2 () | |
| Create uninitialized vector. | |
| vector2 (scalar_t a, scalar_t b) | |
| Create vector initialized with 2 scalar values. | |
| const scalar_t & | operator[] (int i) const |
| operator [] is used to read, () is to write (to preserve const correctness) | |
| scalar_t & | operator() (int i) |
| () is used to write, [] is to read (to preserve const correctness) | |
| scalar_t & | x () |
| Shortcut to vector[0]. | |
| scalar_t & | y () |
| Shortcut to vector[1]. | |
| scalar_t | length2 () const |
| Euclidean length of the vector. | |
| scalar_t | length2squared () const |
| Euclidean length of the vector, squared. | |
| vector2 | operator+ (const vector2 &other) |
| operator + between two 2-dimentional vectors | |
| vector2 & | operator+= (const vector2 &other) |
| operator += between two 2-dimentional vectors | |
| vector2 | operator- (const vector2 &other) |
| operator - between two 2-dimentional vectors | |
| vector2 & | operator-= (const vector2 &other) |
| operator -= between two 2-dimentional vectors | |
|
|
Create uninitialized vector.
|
|
||||||||||||
|
Create vector initialized with 2 scalar values.
|
|
|
operator [] is used to read, () is to write (to preserve const correctness)
|
|
|
() is used to write, [] is to read (to preserve const correctness)
|
|
|
Shortcut to vector[0]. Included for convenience only. |
|
|
Shortcut to vector[1]. Included for convenience only. |
|
|
Euclidean length of the vector.
|
|
|
Euclidean length of the vector, squared. This is faster to compute than length, and is often sufficient for the task. |
|
|
operator + between two 2-dimentional vectors
|
|
|
operator += between two 2-dimentional vectors
|
|
|
operator - between two 2-dimentional vectors
|
|
|
operator -= between two 2-dimentional vectors
|
1.3.6