#include <vec2ll.h>
This class defines a two-dimensional vector whose coordinates are stored using 64-bit integers.
This class is typically used to identify a cell within a regular two-dimensional grid.
Creation & Initialization | |
Vec2LL () | |
Vec2LL (KyInt64 _x, KyInt64 _y) | |
Vec2LL (KyInt64 *coords) | |
void | Set (KyInt64 _x, KyInt64 _y) |
void | Set (KyInt64 *coords) |
Operators | |
KyInt64 | operator[] (KyInt64 idx) const |
KyInt64 & | operator[] (KyInt64 idx) |
bool | operator== (const Vec2LL &v) const |
bool | operator!= (const Vec2LL &v) const |
bool | operator< (const Vec2LL &v) const |
Vec2LL & | operator*= (KyInt64 s) |
Vec2LL & | operator/= (KyInt64 d) |
Vec2LL & | operator+= (KyInt64 t) |
Vec2LL & | operator-= (KyInt64 t) |
Vec2LL & | operator+= (const Vec2LL &v) |
Vec2LL & | operator-= (const Vec2LL &v) |
Vec2LL | operator* (KyInt64 s) const |
Vec2LL | operator/ (KyInt64 d) const |
Vec2LL | operator+ (const Vec2LL &v) const |
Vec2LL | operator- (const Vec2LL &v) const |
Vec2LL | operator- () const |
KyInt64 | operator* (const Vec2LL &v) const |
KyInt64 | operator^ (const Vec2LL &v) const |
Main interface | |
KyInt64 | CrossProd (const Vec2LL &v) const |
KyInt64 | GetSquareLength () const |
Vec2LL | PerpCCW () const |
Vec2LL | PerpCW () const |
void | SetAdditionResult (const Vec2LL &v1, const Vec2LL &v2) |
Static methods | |
static Vec2LL | UnitX () |
static Vec2LL | UnitY () |
Public Data Members | |
KyInt64 | x |
KyInt64 | y |
|
inline |
Creates a vector with coordinates (0,0).
Creates a vector with the specified coordinates.
_x | The size of the vector on the X axis. |
_y | The size of the vector on the Y axis. |
|
inlineexplicit |
Creates a vector with the specified coordinates.
coords | An array of two integers that contains the size of the vector along the X and Y axes respectively. |
Returns the magnitude on the Z axis of the cross product between this vector and v.
|
inline |
Returns the square of the magnitude of the vector.
|
inline |
Returns true if this object contains at least one different coordinate from v.
Multiplies both the X and Y coordinates of the vector by the specified value.
Returns the dot product of this vector and v.
Multiplies both the X and Y coordinates of this vector by the specified value.
Adds the X coordinate of v to the X coordinate of this vector, and adds the Y coordinate of v to the Y coordinate of this vector.
Addst to both the X and Y coordinates of this vector.
Adds the X coordinate of v to the X coordinate of this vector, and adds the Y coordinate of v to the Y coordinate of this vector.
Subtracts the X coordinate of v from the X coordinate of this vector, and subtracts the Y coordinate of v from the Y coordinate of this vector.
|
inline |
Negates the X and Y coordinates of this vector, effectively flipping it around the origin.
Subtractst from both the X and Y coordinates of this vector.
Subtracts the X coordinate of v from the X coordinate of this vector, and subtracts the Y coordinate of v from the Y coordinate of this vector.
Divides both the X and Y coordinates of the vector by the specified value.
Divides both the X and Y coordinates of this vector by the specified value.
|
inline |
Returns true if the size of this vector along both the X and Y axes is less than that of v.
|
inline |
Returns true if this object contains the same coordinates as v.
Retrieves the size of the vector around one of its axes.
Use [0] for the X axis, or [1] for the Y axis.
Retrieves the size of the vector around one of its axes.
Use [0] for the X axis, or [1] for the Y axis. Non-const and returned as a reference to allow modification of the member.
Returns the magnitude on the Z axis of the cross product between this vector and v.
|
inline |
Rotates this vector 90 degrees counter-clockwise (negating the Y coordinate).
|
inline |
Rotates this vector 90 degrees clockwise (negating the X coordinate).
Sets the coordinates of the vector to match the specified values.
_x | The size of the vector on the X axis. |
_y | The size of the vector on the Y axis. |
|
inline |
Sets the coordinates of the vector to match the specified values.
coords | An array of two floating-point numbers that contains the size of the vector along the X and Y axes respectively. |
|
inlinestatic |
Returns the normalized orientation of the X axis.
|
inlinestatic |
Returns the normalized orientation of the Y axis.
KyInt64 Kaim::Vec2LL::x |
The size of the vector along the X axis.
KyInt64 Kaim::Vec2LL::y |
The size of the vector along the Y axis.