2D Integer vector. More...
#include <Vec2i.h>
Public Member Functions | |
Vec2i () | |
Construct 0 vector. | |
Vec2i (int _a, int _b) | |
Construct 2D int vector. | |
Vec2i (int a) | |
Construct a 2D integer vector with two identical coordinates. | |
Vec2i (const Vec2f &v) | |
Convert from 2D float vector. | |
![]() | |
void | set (int_a, int_b) |
Set all coordinates of a 2D vector. | |
void | set (int_a, int_b, int_c) |
Set all coordinates of a 3D vector. | |
void | set (int_a, int_b, int_c, int_d) |
Set all coordinates of a 4D vector. | |
const int & | operator[] (unsigned int i) const |
Const index operator. | |
int & | operator[] (unsigned int i) |
Non-const index operator. | |
const int & | operator() (unsigned int i) const |
Const index operator. | |
int & | operator() (unsigned int i) |
Non-const index operator. | |
int * | get () |
const int * | get () const |
bool | operator== (const Vec2i &v) const |
Equality operator. | |
bool | operator== (intk) const |
Equality wrt scalar. True if all coords are equal to scalar. | |
bool | operator!= (const Vec2i &v) const |
Inequality operator. | |
bool | operator!= (intk) const |
Inequality wrt scalar. True if any coord not equal to scalar. | |
bool | all_l (const Vec2i &v) const |
bool | all_le (const Vec2i &v) const |
bool | all_g (const Vec2i &v) const |
bool | all_ge (const Vec2i &v) const |
const Vec2i & | operator*= (intk) |
Assignment multiplication with scalar. | |
const Vec2i & | operator*= (const Vec2i &v) |
const Vec2i & | operator/= (intk) |
Assignment division with scalar. | |
const Vec2i & | operator/= (const Vec2i &v) |
Assigment division with vector. Each coord divided independently. | |
const Vec2i & | operator+= (intk) |
Assignment addition with scalar. Adds scalar to each coordinate. | |
const Vec2i & | operator+= (const Vec2i &v) |
Assignmment addition with vector. | |
const Vec2i & | operator-= (intk) |
Assignment subtraction with scalar. Subtracts scalar from each coord. | |
const Vec2i & | operator-= (const Vec2i &v) |
Assignment subtraction with vector. | |
const Vec2i | operator- () const |
Negate vector. | |
const Vec2i | operator- (const Vec2i &v1) const |
Subtract two vectors. | |
const Vec2i | operator* (const Vec2i &v1) const |
const Vec2i | operator* (intk) const |
Multiply scalar onto vector. | |
const Vec2i | operator+ (const Vec2i &v1) const |
Add two vectors. | |
const Vec2i | operator/ (const Vec2i &v1) const |
Divide two vectors. Each coord separately. | |
const Vec2i | operator/ (intk) const |
Divide vector by scalar. | |
const int | min_coord () const |
Return the smallest coordinate of the vector. | |
const int | max_coord () const |
Return the largest coordinate of the vector. | |
Additional Inherited Members | |
![]() | |
typedef int | ScalarType |
For convenience we define a more meaningful name for the scalar type. | |
typedef Vec2i | VectorType |
A more meaningful name for vector type. | |
![]() | |
static unsigned int | get_dim () |
Return dimension of vector. | |
![]() | |
ArithVec () | |
Construct uninitialized vector. | |
ArithVec (int_a) | |
Construct a vector where all coordinates are identical. | |
ArithVec (int_a, int_b) | |
Construct a 2D vector. | |
ArithVec (int_a, int_b, int_c) | |
Construct a 3D vector. | |
ArithVec (int_a, int_b, int_c, int_d) | |
Construct a 4D vector. | |
![]() | |
int | data [N] |
The actual contents of the vector. | |
2D Integer vector.