Rebel Fork Framework
|
Two-dimensional vector with integer values. More...
#include <Urho3D/Math/Vector2.h>
Public Member Functions | |
IntVector2 () noexcept | |
Construct a zero vector. | |
IntVector2 (int x, int y) noexcept | |
Construct from coordinates. | |
IntVector2 (const int data[]) noexcept | |
Construct from an int array. | |
IntVector2 (const float data[]) | |
Construct from an float array. | |
IntVector2 (const IntVector2 &rhs) noexcept=default | |
Copy-construct from another vector. | |
IntVector2 & | operator= (const IntVector2 &rhs) noexcept=default |
Assign from another vector. | |
bool | operator== (const IntVector2 &rhs) const |
Test for equality with another vector. | |
bool | operator!= (const IntVector2 &rhs) const |
Test for inequality with another vector. | |
bool | operator< (const IntVector2 &rhs) const |
Lexicographic comparison for sorting. | |
IntVector2 | operator+ (const IntVector2 &rhs) const |
Add a vector. | |
IntVector2 | operator- () const |
Return negation. | |
IntVector2 | operator- (const IntVector2 &rhs) const |
Subtract a vector. | |
IntVector2 | operator* (int rhs) const |
Multiply with a scalar. | |
IntVector2 | operator* (const IntVector2 &rhs) const |
Multiply with a vector. | |
IntVector2 | operator/ (int rhs) const |
Divide by a scalar. | |
IntVector2 | operator/ (const IntVector2 &rhs) const |
Divide by a vector. | |
IntVector2 & | operator+= (const IntVector2 &rhs) |
Add-assign a vector. | |
IntVector2 & | operator-= (const IntVector2 &rhs) |
Subtract-assign a vector. | |
IntVector2 & | operator*= (int rhs) |
Multiply-assign a scalar. | |
IntVector2 & | operator*= (const IntVector2 &rhs) |
Multiply-assign a vector. | |
IntVector2 & | operator/= (int rhs) |
Divide-assign a scalar. | |
IntVector2 & | operator/= (const IntVector2 &rhs) |
Divide-assign a vector. | |
const int * | Data () const |
Return integer data. | |
ea::string | ToString () const |
Return as string. | |
unsigned | ToHash () const |
Return hash value for HashSet & HashMap. | |
float | Length () const |
Return length. | |
Vector2 | ToVector2 () const |
Return Vector2 vector. | |
IntVector3 | ToIntVector3 (int z=0) const |
Return IntVector3 vector. | |
Vector3 | ToVector3 (float z=0.0f) const |
Return Vector3 vector. | |
Vector4 | ToVector4 (float z=0.0f, float w=0.0f) const |
Return Vector4 vector. | |
Public Attributes | |
int | x_ |
X coordinate. | |
int | y_ |
Y coordinate. | |
Static Public Attributes | |
static const IntVector2 | ZERO |
Zero vector. | |
static const IntVector2 | LEFT |
(-1,0) vector. | |
static const IntVector2 | RIGHT |
(1,0) vector. | |
static const IntVector2 | UP |
(0,1) vector. | |
static const IntVector2 | DOWN |
(0,-1) vector. | |
static const IntVector2 | ONE |
(1,1) vector. | |
Two-dimensional vector with integer values.