gwnavruntime/math/vec2ll.h Source File
Go to the documentation of this file.
30 void Set(
KyInt64* coords) { x = coords[0]; y = coords[1]; }
39 bool operator==(
const Vec2LL& v)
const {
return x == v.x && y == v.y; }
40 bool operator!=(
const Vec2LL& v)
const {
return !operator==(v); }
43 bool operator<=(
const Vec2LL& v)
const {
return (x != v.x) ? x < v.x : y <= v.y; }
44 bool operator>(
const Vec2LL& v)
const {
return (x != v.x) ? x > v.x : y > v.y; }
45 bool operator>=(
const Vec2LL& v)
const {
return (x != v.x) ? x < v.x : y >= v.y; }
47 Vec2LL& operator*=(
KyInt64 s) { x *= s; y *= s;
return *
this; }
48 Vec2LL& operator/=(
KyInt64 d) { x /= d; y /= d;
return *
this; }
49 Vec2LL& operator+=(
const Vec2LL& v) { x += v.x; y += v.y;
return *
this; }
50 Vec2LL& operator-=(
const Vec2LL& v) { x -= v.x; y -= v.y;
return *
this; }
60 KyInt64 GetSquareLength()
const {
return x * x + y * y; }
61 KyInt64 SqLength()
const {
return x * x + y * y; }
80 inline KyInt64 DotProduct(
const Vec2LL& v1,
const Vec2LL& v2) {
return v1.x * v2.x + v1.y * v2.y; }
81 inline KyInt64 CrossProduct(
const Vec2LL& v1,
const Vec2LL& v2) {
return v1.x * v2.y - v1.y * v2.x; }
83 template <
class OSTREAM>
84 inline OSTREAM& operator<<(OSTREAM& os,
const Vec2LL& v)
86 os <<
"{" << v.x <<
"," << v.y <<
"}";
Vec2LL(KyInt64 *coords)
Constructs x=coords[0], y=coords[1].
Definition: vec2ll.h:27
Vec2LL(KyInt64 _x, KyInt64 _y)
Constructs x=_x, y=_y.
Definition: vec2ll.h:26
Vec2LL()
Constructs x=0.0f, y=0.0f.
Definition: vec2ll.h:25
2d vector using KyInt64
Definition: vec2ll.h:18
void Clear()
Sets x=0 and y=0.
Definition: vec2ll.h:32
#define KY_DEFINE_NEW_DELETE_OPERATORS(MemStat)
This macro defines new and delete operators.
Definition: memory.h:132
std::int64_t KyInt64
int64_t
Definition: types.h:25
The Autodesk Navigation namespace.
Definition: gamekitcrowddispersion.cpp:17
bool operator<(const Vec2LL &v) const
x is compared first. ex: {1, 5} < {2,="" 0}.="" />
Definition: vec2ll.h:42