#include <vec2i.h>
2d vector using KyInt32
Inherited by Kaim::RasterPoint.
Functions | |
Vec2i () | |
Constructs x=0.0f, y=0.0f. More... | |
Vec2i (KyInt32 _x, KyInt32 _y) | |
Constructs x=_x, y=_y. More... | |
Vec2i (KyInt32 *coords) | |
Constructs x=coords[0], y=coords[1]. More... | |
void | Set (KyInt32 _x, KyInt32 _y) |
Sets x=_x and y=_y. More... | |
void | Set (KyInt32 *coords) |
Sets x=coords[0], y=coords[1]. More... | |
void | Clear () |
Sets x = 0 and y = 0. More... | |
Operators | |
KyInt32 & | operator[] (KyInt32 idx) |
KyInt32 | operator[] (KyInt32 idx) const |
bool | operator== (const Vec2i &v) const |
bool | operator!= (const Vec2i &v) const |
bool | operator< (const Vec2i &v) const |
x is compared first. ex: {1, 5} < {2, 0}. More... | |
bool | operator<= (const Vec2i &v) const |
bool | operator> (const Vec2i &v) const |
bool | operator>= (const Vec2i &v) const |
Vec2i & | operator*= (KyInt32 s) |
Vec2i & | operator/= (KyInt32 d) |
Vec2i & | operator+= (const Vec2i &v) |
Vec2i & | operator-= (const Vec2i &v) |
Vec2i | operator* (KyInt32 s) const |
Vec2i | operator/ (KyInt32 d) const |
Vec2i | operator+ (const Vec2i &v) const |
Vec2i | operator- (const Vec2i &v) const |
Vec2i | operator- () const |
SquareLength | |
KyInt64 | SqLength () const |
KyInt64 | SqLength_15bits () const |
bool | IsZero () const |
Offset | |
Vec2i | OffsetX (KyInt32 dx) const |
Returns {x + dx, y}. More... | |
Vec2i | OffsetY (KyInt32 dy) const |
Returns {x, y + dy}. More... | |
Vec2i | Offset (KyInt32 dx, KyInt32 dy) const |
Returns {x + dx, y + dy}. More... | |
Rotation | |
Vec2i | PerpCCW () const |
Vec2i | PerpCW () const |
Side | |
KyInt64 | Orient2d (const Vec2i &A, const Vec2i &B) const |
CrossProduct(MA, MB) where M=*this. More... | |
bool | IsOnLeftSide (const Vec2i &A, const Vec2i &B) const |
bool | IsStrictlyOnLeftSide (const Vec2i &A, const Vec2i &B) const |
IsInside | |
bool | IsInsideTriangle (const Vec2i &A, const Vec2i &B, const Vec2i &C) const |
bool | IsInsideNotColinearTriangle (const Vec2i &A, const Vec2i &B, const Vec2i &C) const |
bool | IsStrictlyInsideTriangle (const Vec2i &A, const Vec2i &B, const Vec2i &C) const |
Zero, Unit | |
static Vec2i | Zero () |
static Vec2i | UnitX () |
static Vec2i | UnitY () |
Neighbors | |
Vec2i | NeighborEast () const |
Vec2i | NeighborWest () const |
Vec2i | NeighborNorth () const |
Vec2i | NeighborSouth () const |
void | NeighborEast (Vec2i &neighbor) const |
void | NeighborWest (Vec2i &neighbor) const |
void | NeighborNorth (Vec2i &neighbor) const |
void | NeighborSouth (Vec2i &neighbor) const |
Vec2i | Neighbor (CardinalDir dir) const |
void | Neighbor (CardinalDir dir, Vec2i &neighbor) const |
Vec2i | NeighborNorthEast () const |
Vec2i | NeighborNorthWest () const |
Vec2i | NeighborSouthEast () const |
Vec2i | NeighborSouthWest () const |
Data | |
KyInt32 | x |
KyInt32 | y |
|
inline |
Constructs x=0.0f, y=0.0f.
|
inlineexplicit |
Constructs x=coords[0], y=coords[1].
|
inline |
Sets x = 0 and y = 0.
|
inline |
x is compared first. ex: {1, 5} < {2, 0}.
CrossProduct(MA, MB) where M=*this.
|
inline |
Sets x=coords[0], y=coords[1].