9 #ifndef Navigation_Vec3i_H
10 #define Navigation_Vec3i_H
56 KY_INLINE
void Set(
KyInt32* coords) {
x = coords[0];
y = coords[1];
z = coords[2]; }
70 KY_INLINE
bool operator==(
const Vec3i& v)
const {
return x == v.x &&
y == v.y &&
z == v.z; }
73 KY_INLINE
bool operator!=(
const Vec3i& v)
const {
return x != v.x ||
y != v.y ||
z != v.z; }
78 if (
x < v.
x)
return true;
79 if (
x > v.
x)
return false;
80 if (
y < v.
y)
return true;
81 if (
y > v.
y)
return false;
168 SwapEndianness(e,
self.x);
169 SwapEndianness(e,
self.y);
170 SwapEndianness(e,
self.z);
KyInt32 z
The size of the vector along the Z axis.
Definition: vec3i.h:182
Vec3i()
Creates a vector with coordinates (0,0,0).
Definition: vec3i.h:34
Vec3i operator-() const
Negates the X, Y and Z coordinates of this vector, effectively flipping it around the origin...
Definition: vec3i.h:123
This class defines a three-dimensional vector whose coordinates are stored using 32-bit integers...
Definition: vec3i.h:21
Vec3i & operator+=(const Vec3i &v)
Adds the X coordinate of v to the X coordinate of this vector, adds the Y coordinate of v to the Y co...
Definition: vec3i.h:102
Vec3i operator+(const Vec3i &v) const
Adds the X coordinate of v to the X coordinate of this vector, adds the Y coordinate of v to the Y co...
Definition: vec3i.h:116
void Set(const Vec2i &v, KyInt32 _z)
Sets the coordinates of the vector to match the specified values.
Definition: vec3i.h:56
bool operator<(const Vec3i &v) const
Returns true if the size of this vector along all three of the X, Y and Z axes is less than that of v...
Definition: vec3i.h:85
KyInt32 Orient2d(const Vec3i &A, const Vec3i &B) const
Indicates whether or not the polyline formed by (A to B to this vector ) outlines a triangle in count...
Definition: vec3i.h:144
bool operator==(const Vec3i &v) const
Returns true if this object contains the same coordinates as v.
Definition: vec3i.h:79
Vec3i operator^(const Vec3i &v) const
Returns the cross product of this vector and v.
Definition: vec3i.h:129
Vec3i & operator*=(KyInt32 s)
Multiplies the X, Y and Z coordinates of this vector by the specified value.
Definition: vec3i.h:95
int KyInt32
Type used internally to represent a 32-bit integer.
Definition: types.h:35
KyInt32 x
The size of the vector along the X axis.
Definition: vec2i.h:283
KyInt32 x
The size of the vector along the X axis.
Definition: vec3i.h:180
Vec3i operator/(KyInt32 d) const
Divides the X, Y and Z coordinates of this vector by the specified value.
Definition: vec3i.h:112
Vec3i & operator-=(const Vec3i &v)
Subtracts the X coordinate of v from the X coordinate of this vector, subtracts the Y coordinate of v...
Definition: vec3i.h:106
static Vec3i UnitZ()
Returns the normalized orientation of the Y axis.
Definition: vec3i.h:171
KyInt32 GetSquareLength() const
Returns the square of the magnitude of the vector.
Definition: vec3i.h:155
KyInt32 y
The size of the vector along the Y axis.
Definition: vec2i.h:284
Target
Enumerates the possible endianness types relative to the current platform.
Definition: endianness.h:35
static Vec3i UnitX()
Returns the normalized orientation of the X axis.
Definition: vec3i.h:165
Vec3i & operator/=(KyInt32 d)
Divides the X, Y and Z coordinates of this vector by the specified value.
Definition: vec3i.h:98
bool IsStrictlyOnLeftSide(const Vec3i &A, const Vec3i &B) const
Returns true if this vector is on the left side when moving from A to B, but not if this vector is on...
Definition: vec3i.h:152
KyInt32 y
The size of the vector along the Y axis.
Definition: vec3i.h:181
This class defines a two-dimensional vector whose coordinates are stored using 32-bit integers...
Definition: vec2i.h:26
Definition: gamekitcrowddispersion.h:20
static Vec3i UnitY()
Returns the normalized orientation of the Y axis.
Definition: vec3i.h:168
#define KY_DEFINE_NEW_DELETE_OPERATORS(MemStat)
This macro defines new and delete operators.
Definition: memory.h:137
Vec3i(KyInt32 _x, KyInt32 _y, KyInt32 _z)
Creates a vector with the specified coordinates.
Definition: vec3i.h:40
void Set(KyInt32 _x, KyInt32 _y, KyInt32 _z)
Sets the coordinates of the vector to match the specified values.
Definition: vec3i.h:51
bool operator!=(const Vec3i &v) const
Returns true if this object contains at least one different coordinate from v.
Definition: vec3i.h:82
Vec3i operator*(KyInt32 s) const
Multiplies the X, Y and Z coordinates of this vector by the specified value.
Definition: vec3i.h:109
KyInt32 & operator[](KyInt32 i)
Retrieves the size of the vector around one of its axes.
Definition: vec3i.h:72
bool IsOnLeftSide(const Vec3i &A, const Vec3i &B) const
Returns true if this vector is on the left side when moving from A to B, or if this vector is on the ...
Definition: vec3i.h:148