gwnavruntime/math/vec3i.h Source File
Go to the documentation of this file.
22 Vec3i() : x(0), y(0), z(0) {}
27 void Set(
const Vec2i& v,
KyInt32 _z) { x = v.x; y = v.y; z = _z; }
28 void Set(
KyInt32* coords) { x = coords[0]; y = coords[1]; z = coords[2]; }
35 bool operator==(
const Vec3i& v)
const {
return x == v.x && y == v.y && z == v.z; }
36 bool operator!=(
const Vec3i& v)
const {
return x != v.x || y != v.y || z != v.z; }
39 bool operator>(
const Vec3i& v)
const;
40 bool operator<=(
const Vec3i& v)
const {
return !operator>(v); }
43 Vec3i& operator*=(
KyInt32 s) { x *= s; y *= s; z *= s;
return *
this; }
44 Vec3i& operator/=(
KyInt32 d) { x /= d; y /= d; z /= d;
return *
this; }
45 Vec3i& operator+=(
const Vec3i& v) { x += v.x; y += v.y; z += v.z;
return *
this; }
46 Vec3i& operator-=(
const Vec3i& v) { x -= v.x; y -= v.y; z -= v.z;
return *
this; }
50 Vec3i operator+(
const Vec3i& v)
const {
return Vec3i(x + v.x, y + v.y, z + v.z); }
51 Vec3i operator-(
const Vec3i& v)
const {
return Vec3i(x - v.x, y - v.y, z - v.z); }
52 Vec3i operator-()
const {
return Vec3i(-x, -y, -z); }
56 KyInt32 GetSquareLength()
const {
return x * x + y * y + z * z; }
62 bool IsOnLeftSide(
const Vec3i& A,
const Vec3i& B)
const {
return Orient2d(A, B) >= 0; }
63 bool IsStrictlyOnLeftSide(
const Vec3i& A,
const Vec3i& B)
const {
return Orient2d(A, B) > 0; }
67 static Vec3i UnitX() {
return Vec3i(1, 0, 0); }
68 static Vec3i UnitY() {
return Vec3i(0, 1, 0); }
69 static Vec3i UnitZ() {
return Vec3i(0, 0, 1); }
80 if (x < v.x)
return true;
81 if (x > v.x)
return false;
82 if (y < v.y)
return true;
83 if (y > v.y)
return false;
87 inline bool Vec3i::operator>(
const Vec3i& v)
const
89 if (x > v.x)
return true;
90 if (x < v.x)
return false;
91 if (y > v.y)
return true;
92 if (y < v.y)
return false;
98 SwapEndianness(e,
self.x);
99 SwapEndianness(e,
self.y);
100 SwapEndianness(e,
self.z);
3d vector using 32bits integer
Definition: vec3i.h:15
bool operator<(const Vec3i &v) const
x is compared first. ex: {1, 5, 0} < {2,="" 0,="" 0}.="" />
Definition: vec3i.h:78
KyInt32 Orient2d(const Vec3i &A, const Vec3i &B) const
CrossProduct(MA, MB) where M=*this.
Definition: vec3i.h:61
#define KY_DEFINE_NEW_DELETE_OPERATORS(MemStat)
This macro defines new and delete operators.
Definition: memory.h:132
Target
Enumerates the possible endianness types relative to the current platform.
Definition: endianness.h:27
2d vector using KyInt32
Definition: vec2i.h:18
The Autodesk Navigation namespace.
Definition: gamekitcrowddispersion.cpp:17
std::int32_t KyInt32
int32_t
Definition: types.h:24