Integer version of Vector2. More...
Public Member Functions | |
Vector2i (int x, int y) | |
Vector2i constructor. | |
Vector2 | Vector2 () |
Return this as a Vector2 (cast to float). | |
Vector2i | Max (Vector2i value) |
Element wise max. | |
Vector2i | Min (Vector2i value) |
Element wise min. | |
Vector2i | Clamp (Vector2i min, Vector2i max) |
Element wise clamp. | |
Vector2i | ClampIndex (Vector2i n) |
Element wise index clamp. | |
Vector2i | WrapIndex (Vector2i n) |
Element wise index wrap. | |
int | Product () |
Return the product of elements, X * Y. | |
bool | Equals (Vector2i v) |
Equality test. | |
override bool | Equals (Object o) |
Equality test. | |
override string | ToString () |
Return the string representation of this vector. | |
override int | GetHashCode () |
Gets the hash code for this vector. | |
Static Public Member Functions | |
static Vector2i | operator+ (Vector2i a, Vector2i value) |
Element wise addition. | |
static Vector2i | operator- (Vector2i a, Vector2i value) |
Element wise subtraction. | |
static Vector2i | operator* (Vector2i a, Vector2i value) |
Element wise multiplication. | |
static Vector2i | operator* (Vector2i a, int value) |
Element wise multiplication. | |
static Vector2i | operator* (int value, Vector2i a) |
Element wise multiplication. | |
static Vector2i | operator/ (Vector2i a, Vector2i value) |
Element wise division. | |
static Vector2i | operator- (Vector2i a) |
Unary minus operator. | |
static bool | operator== (Vector2i a, Vector2i value) |
Return true if all elements are equal. | |
static bool | operator!= (Vector2i a, Vector2i value) |
Return true if at least one element is non equal. | |
Public Attributes | |
int | X |
X. | |
int | Y |
Y. | |
Properties | |
Vector2i | Yx [get] |
Integer version of Vector2.
Element wise index clamp.
X is clamped to [0,n.X-1] Y is clamped to [0,n.Y-1]
n | The 2d size "this" components must be clamped against. The components of n are assumed to be positive (values of n.X or n.Y negative or zero will result in undefined behaviour). |
Element wise index wrap.
X wraps around [0,n.X-1] Y wraps around [0,n.Y-1] This's (X,Y) is assumed to be a 2d index in a 2d table of size (n.X,n.Y). If X or Y are not in the valid array range, they are wrapped around [0,n.X-1] and [0,n.Y-1] respectively (-1 becomes n-1, n becomes 0, n+1 becomes 1 etc), else their value is unchanged.
n | The 2d size "this" components must be wrapped around. The components of n are assumed to be positive (values of n.X or n.Y negative or zero will result in undefined behaviour). |
int X |
X.
int Y |
Y.
Vector2i Yx [get] |