Dry
|
Three-dimensional vector with integer values. More...
#include <Dry/Math/Vector3.h>
Public Member Functions | |
IntVector3 () noexcept | |
Construct a zero vector. | |
IntVector3 (const IntVector2 &vector, int z=0) noexcept | |
Construct from a two-dimensional vector and the Z coordinate. | |
IntVector3 (int x, int y, int z) noexcept | |
Construct from coordinates. | |
IntVector3 (const int *data) noexcept | |
Construct from an int array. | |
IntVector3 (const IntVector3 &rhs) noexcept=default | |
Copy-construct from another vector. | |
IntVector3 & | operator= (const IntVector3 &rhs) noexcept=default |
Assign from another vector. | |
bool | operator== (const IntVector3 &rhs) const |
Test for equality with another vector. | |
bool | operator!= (const IntVector3 &rhs) const |
Test for inequality with another vector. | |
IntVector3 | operator+ (const IntVector3 &rhs) const |
Add a vector. | |
IntVector3 | operator- () const |
Return negation. | |
IntVector3 | operator- (const IntVector3 &rhs) const |
Subtract a vector. | |
IntVector3 | operator* (int rhs) const |
Multiply with a scalar. | |
Vector3 | operator* (float rhs) |
Multiply IntVector3 with a float scalar. | |
IntVector3 | operator* (const IntVector3 &rhs) const |
Multiply with another int vector. | |
Vector3 | operator* (const Vector3 &rhs) const |
Multiply with float vector. | |
IntVector3 | operator/ (int rhs) const |
Divide by an int scalar. | |
Vector3 | operator/ (float rhs) const |
Divide by a float scalar. | |
IntVector3 | operator/ (const IntVector3 &rhs) const |
Divide by another int vector. | |
Vector3 | operator/ (const Vector3 &rhs) const |
Divide by a float vector. | |
IntVector3 & | operator+= (const IntVector3 &rhs) |
Add-assign a vector. | |
IntVector3 & | operator-= (const IntVector3 &rhs) |
Subtract-assign a vector. | |
IntVector3 & | operator*= (int rhs) |
Multiply-assign a scalar. | |
IntVector3 & | operator*= (const IntVector3 &rhs) |
Multiply-assign a vector. | |
IntVector3 & | operator/= (int rhs) |
Divide-assign a scalar. | |
IntVector3 & | operator/= (const IntVector3 &rhs) |
Divide-assign a vector. | |
const int * | Data () const |
Return integer data. | |
String | ToString () const |
Return as string. | |
unsigned | ToHash () const |
Return hash value for HashSet & HashMap. | |
float | Length () const |
Return length. | |
Public Attributes | |
int | x_ |
X coordinate. | |
int | y_ |
Y coordinate. | |
int | z_ |
Z coordinate. | |
Static Public Attributes | |
static const IntVector3 | ZERO {} |
Zero vector. | |
static const IntVector3 | LEFT { -1, 0, 0 } |
(-1,0,0) vector. | |
static const IntVector3 | RIGHT { 1, 0, 0 } |
(1,0,0) vector. | |
static const IntVector3 | UP { 0, 1, 0 } |
(0,1,0) vector. | |
static const IntVector3 | DOWN { 0, -1, 0 } |
(0,-1,0) vector. | |
static const IntVector3 | FORWARD { 0, 0, 1 } |
(0,0,1) vector. | |
static const IntVector3 | BACK { 0, 0, -1 } |
(0,0,-1) vector. | |
static const IntVector3 | ONE { 1, 1, 1 } |
(1,1,1) vector. | |
Three-dimensional vector with integer values.