9 #ifndef Navigation_Vec2L_H
10 #define Navigation_Vec2L_H
54 KY_INLINE
void Set(
KyInt64* coords) {
x = coords[0];
y = coords[1]; }
76 if (
x < v.
x)
return true;
77 if (
x > v.
x)
return false;
139 KY_INLINE
void SetAdditionResult(
const Vec2LL& v1,
const Vec2LL& v2) {
x = v1.x + v2.x;
y = v1.y + v2.y; }
160 KY_INLINE
KyInt64 DotProduct(
const Vec2LL& v1,
const Vec2LL& v2) {
return v1 * v2; }
166 template <
class OSTREAM>
167 inline OSTREAM& operator<<(OSTREAM& os,
const Kaim::Vec2LL& v)
169 os <<
"{" << v.
x <<
";" << v.
y <<
"}";
KyInt64 x
The size of the vector along the X axis.
Definition: vec2ll.h:175
Vec2LL operator+(const Vec2LL &v) const
Adds the X coordinate of v to the X coordinate of this vector, and adds the Y coordinate of v to the ...
Definition: vec2ll.h:119
static Vec2LL UnitY()
Returns the normalized orientation of the Y axis.
Definition: vec2ll.h:166
Vec2LL PerpCW() const
Rotates this vector 90 degrees clockwise (negating the X coordinate).
Definition: vec2ll.h:151
KyInt64 CrossProd(const Vec2LL &v) const
Returns the magnitude on the Z axis of the cross product between this vector and v.
Definition: vec2ll.h:142
KyFloat32 CrossProduct(const Vec2f &v1, const Vec2f &v2)
Returns the magnitude on the Z axis of the cross product between this vector and v.
Definition: vec2f.h:190
Vec2LL & operator/=(KyInt64 d)
Divides both the X and Y coordinates of this vector by the specified value.
Definition: vec2ll.h:95
bool operator==(const Vec2LL &v) const
Returns true if this object contains the same coordinates as v.
Definition: vec2ll.h:78
Vec2LL()
Creates a vector with coordinates (0,0).
Definition: vec2ll.h:40
This class defines a two-dimensional vector whose coordinates are stored using 64-bit integers...
Definition: vec2ll.h:27
static Vec2LL UnitX()
Returns the normalized orientation of the X axis.
Definition: vec2ll.h:163
Vec2LL PerpCCW() const
Rotates this vector 90 degrees counter-clockwise (negating the Y coordinate).
Definition: vec2ll.h:148
KyInt64 y
The size of the vector along the Y axis.
Definition: vec2ll.h:176
Vec2LL operator/(KyInt64 d) const
Divides both the X and Y coordinates of the vector by the specified value.
Definition: vec2ll.h:115
KyInt64 operator^(const Vec2LL &v) const
Returns the magnitude on the Z axis of the cross product between this vector and v.
Definition: vec2ll.h:132
bool operator!=(const Vec2LL &v) const
Returns true if this object contains at least one different coordinate from v.
Definition: vec2ll.h:81
void Set(KyInt64 _x, KyInt64 _y)
Sets the coordinates of the vector to match the specified values.
Definition: vec2ll.h:55
Definition: gamekitcrowddispersion.h:20
KyFloat32 DotProduct(const Vec2f &v1, const Vec2f &v2)
Returns the dot product of v1 and v2.
Definition: vec2f.h:187
Vec2f operator*(KyFloat32 s, const Vec2f &v)
Multiplies the X and Y coordinates of v by s.
Definition: vec2f.h:184
#define KY_DEFINE_NEW_DELETE_OPERATORS(MemStat)
This macro defines new and delete operators.
Definition: memory.h:137
KyInt64 operator[](KyInt64 idx) const
Retrieves the size of the vector around one of its axes.
Definition: vec2ll.h:71
Vec2LL & operator*=(KyInt64 s)
Multiplies both the X and Y coordinates of this vector by the specified value.
Definition: vec2ll.h:92
Vec2LL operator*(KyInt64 s) const
Multiplies both the X and Y coordinates of the vector by the specified value.
Definition: vec2ll.h:112
Vec2LL operator-() const
Negates the X and Y coordinates of this vector, effectively flipping it around the origin...
Definition: vec2ll.h:126
KyInt64 GetSquareLength() const
Returns the square of the magnitude of the vector.
Definition: vec2ll.h:145
bool operator<(const Vec2LL &v) const
Returns true if the size of this vector along both the X and Y axes is less than that of v...
Definition: vec2ll.h:84
Vec2LL & operator-=(KyInt64 t)
Subtractst from both the X and Y coordinates of this vector.
Definition: vec2ll.h:101
__int64 KyInt64
Type used internally to represent a 64-bit integer.
Definition: types.h:37
Vec2LL & operator+=(KyInt64 t)
Addst to both the X and Y coordinates of this vector.
Definition: vec2ll.h:98