#include <vec3i.h>
This class defines a three-dimensional vector whose coordinates are stored using 32-bit integers.
Creation & Initialization | |
Vec3i () | |
Vec3i (KyInt32 _x, KyInt32 _y, KyInt32 _z) | |
Vec3i (KyInt32 *coords) | |
void | Set (KyInt32 _x, KyInt32 _y, KyInt32 _z) |
void | Set (const Vec2i &v, KyInt32 _z) |
void | Set (KyInt32 *coords) |
Operators | |
KyInt32 & | operator[] (KyInt32 i) |
KyInt32 | operator[] (KyInt32 i) const |
bool | operator== (const Vec3i &v) const |
bool | operator!= (const Vec3i &v) const |
bool | operator< (const Vec3i &v) const |
Vec3i & | operator*= (KyInt32 s) |
Vec3i & | operator/= (KyInt32 d) |
Vec3i & | operator+= (const Vec3i &v) |
Vec3i & | operator-= (const Vec3i &v) |
Vec3i | operator* (KyInt32 s) const |
Vec3i | operator/ (KyInt32 d) const |
Vec3i | operator+ (const Vec3i &v) const |
Vec3i | operator- (const Vec3i &v) const |
Vec3i | operator- () const |
KyInt32 | operator* (const Vec3i &v) const |
Vec3i | operator^ (const Vec3i &v) const |
Main interface | |
KyInt32 | Orient2d (const Vec3i &A, const Vec3i &B) const |
bool | IsOnLeftSide (const Vec3i &A, const Vec3i &B) const |
bool | IsStrictlyOnLeftSide (const Vec3i &A, const Vec3i &B) const |
KyInt32 | GetSquareLength () const |
Static methods | |
static Vec3i | UnitX () |
static Vec3i | UnitY () |
static Vec3i | UnitZ () |
Public Data Members | |
KyInt32 | x |
KyInt32 | y |
KyInt32 | z |
|
inline |
Creates a vector with coordinates (0,0,0).
Creates a vector with the specified coordinates.
_x | The size of the vector on the X axis. |
_y | The size of the vector on the Y axis. |
_z | The size of the vector on the Z axis. |
|
inlineexplicit |
Creates a vector with the specified coordinates.
coords | An array of three integers that contains the size of the vector along the X, Y and Z axes respectively. |
|
inline |
Returns the square of the magnitude of the vector.
Returns true if this vector is on the left side when moving from A to B, or if this vector is on the line between A and B.
Returns true if this vector is on the left side when moving from A to B, but not if this vector is on the line between A and B.
|
inline |
Returns true if this object contains at least one different coordinate from v.
Multiplies the X, Y and Z coordinates of this vector by the specified value.
Returns the dot product of this vector and v.
Multiplies the X, Y and Z coordinates of this vector by the specified value.
Adds the X coordinate of v to the X coordinate of this vector, adds the Y coordinate of v to the Y coordinate of this vector, and adds the Z coordinate of v to the Z coordinate of this vector.
Adds the X coordinate of v to the X coordinate of this vector, adds the Y coordinate of v to the Y coordinate of this vector, and adds the Z coordinate of v to the Z coordinate of this vector.
Subtracts the X coordinate of v from the X coordinate of this vector, subtracts the Y coordinate of v from the Y coordinate of this vector, and subtracts the Z coordinate of v from the Z coordinate of this vector.
|
inline |
Negates the X, Y and Z coordinates of this vector, effectively flipping it around the origin.
Subtracts the X coordinate of v from the X coordinate of this vector, subtracts the Y coordinate of v from the Y coordinate of this vector, and subtracts the Z coordinate of v from the Z coordinate of this vector.
Divides the X, Y and Z coordinates of this vector by the specified value.
Divides the X, Y and Z coordinates of this vector by the specified value.
|
inline |
Returns true if the size of this vector along all three of the X, Y and Z axes is less than that of v.
|
inline |
Returns true if this object contains the same coordinates as v.
Retrieves the size of the vector around one of its axes.
Use [0] for the X axis, [1] for the Y axis, or [2] for the Z axis.
Retrieves the size of the vector around one of its axes.
Use [0] for the X axis, [1] for the Y axis, or [2] for the Z axis.
Returns the cross product of this vector and v.
Indicates whether or not the polyline formed by (A to B to this vector ) outlines a triangle in counter-clockwise order when seen from above.
Sets the coordinates of the vector to match the specified values.
_x | The size of the vector on the X axis. |
_y | The size of the vector on the Y axis. |
_z | The size of the vector on the Z axis. |
Sets the coordinates of the vector to match the specified values.
v | A two-dimensional vector that specifies the size on the X and Y axes. |
_z | The size of the vector on the Z axis. |
|
inline |
Sets the coordinates of the vector to match the specified values.
coords | An array of three floating-point numbers that contains the size of the vector along the X, Y and Z axes respectively. |
|
inlinestatic |
Returns the normalized orientation of the X axis.
|
inlinestatic |
Returns the normalized orientation of the Y axis.
|
inlinestatic |
Returns the normalized orientation of the Y axis.
KyInt32 Kaim::Vec3i::x |
The size of the vector along the X axis.
KyInt32 Kaim::Vec3i::y |
The size of the vector along the Y axis.
KyInt32 Kaim::Vec3i::z |
The size of the vector along the Z axis.