API Documentation
IntVector.h
1 // IntVector.h
3 //
5 
6 namespace nkMaths
7 {
11  class IntVector
12  {
13  public :
14 
19  IntVector () noexcept ;
28  IntVector (int x, int y) noexcept ;
38  IntVector (int x, int y, int z) noexcept ;
47  IntVector (int x, int y, int z, int w) noexcept ;
53  IntVector (const Vector& other) noexcept ;
59  IntVector (const IntVector& other) noexcept ;
60 
61  // Getters
65  int getX () const ;
69  int getY () const ;
73  int getZ () const ;
77  int getW () const ;
78 
79  // Setters
85  void setX (int value) ;
91  void setY (int value) ;
97  void setZ (int value) ;
103  void setW (int value) ;
104 
105  // Add
111  void addX (int value) ;
117  void addY (int value) ;
123  void addZ (int value) ;
129  void addW (int value) ;
135  void multX (int value) ;
141  void multY (int value) ;
147  void multZ (int value) ;
153  void multW (int value) ;
154 
155  // Length
159  float getLengthVec2 () const ;
163  float getLengthVec3 () const ;
167  float getLengthVec4 () const ;
173  float getLengthSquaredVec2 () const ;
179  float getLengthSquaredVec3 () const ;
185  float getLengthSquaredVec4 () const ;
186  // Distance
191  float getDistanceVec2 (const IntVector& other) const ;
196  float getDistanceVec3 (const IntVector& other) const ;
201  float getDistanceVec4 (const IntVector& other) const ;
208  float getDistanceSquaredVec2 (const IntVector& other) const ;
215  float getDistanceSquaredVec3 (const IntVector& other) const ;
222  float getDistanceSquaredVec4 (const IntVector& other) const ;
223 
224  // Practical
228  nkMemory::String toString () const ;
235  IntVector& fromString (nkMemory::StringView str) ;
236 
237  // Operators
244  IntVector& operator= (const IntVector& other) noexcept ;
251  IntVector& operator= (const Vector& other) noexcept ;
258  IntVector operator+ (const IntVector& other) const ;
264  void operator+= (const IntVector& other) ;
271  IntVector operator- (const IntVector& other) const ;
277  void operator-= (const IntVector& other) ;
284  IntVector operator* (const IntVector& other) const ;
290  void operator*= (const IntVector& other) ;
297  IntVector operator* (int coeff) const ;
303  void operator*= (int coeff) ;
310  IntVector operator/ (const IntVector& other) const ;
316  void operator/= (const IntVector& other) ;
323  IntVector operator/ (int coeff) const ;
329  void operator/= (int coeff) ;
336  bool operator== (const IntVector& other) const ;
343  bool operator!= (const IntVector& other) const ;
350  bool operator< (const IntVector& other) const ;
357  bool operator<= (const IntVector& other) const ;
364  bool operator> (const IntVector& other) const ;
371  bool operator>= (const IntVector& other) const ;
372 
373  public :
374 
375  int _x ;
376  int _y ;
377  int _z ;
378  int _w ;
379  } ;
380 }
nkMaths::IntVector::getDistanceVec3
float getDistanceVec3(const IntVector &other) const
nkMaths::IntVector::addW
void addW(int value)
nkMaths::IntVector::multZ
void multZ(int value)
nkMaths::IntVector::_w
int _w
W component of the vector.
Definition: IntVector.h:378
nkMaths::IntVector
A 4-component vector class, with integers.
Definition: IntVector.h:12
nkMaths::IntVector::getLengthVec2
float getLengthVec2() const
nkMaths::IntVector::addX
void addX(int value)
nkMaths::IntVector::getDistanceVec4
float getDistanceVec4(const IntVector &other) const
nkMaths::IntVector::multX
void multX(int value)
nkMaths::IntVector::toString
nkMemory::String toString() const
nkMaths::IntVector::setW
void setW(int value)
nkMaths
Encompasses all API of component NilkinsMaths.
Definition: IntVector.h:7
nkMaths::IntVector::addZ
void addZ(int value)
nkMaths::IntVector::multW
void multW(int value)
nkMaths::IntVector::getLengthVec4
float getLengthVec4() const
nkMaths::IntVector::getDistanceVec2
float getDistanceVec2(const IntVector &other) const
nkMaths::IntVector::getZ
int getZ() const
nkMaths::IntVector::addY
void addY(int value)
nkMaths::IntVector::getDistanceSquaredVec4
float getDistanceSquaredVec4(const IntVector &other) const
nkMaths::IntVector::getLengthSquaredVec4
float getLengthSquaredVec4() const
nkMaths::IntVector::getY
int getY() const
nkMaths::IntVector::getDistanceSquaredVec2
float getDistanceSquaredVec2(const IntVector &other) const
nkMaths::IntVector::getLengthSquaredVec3
float getLengthSquaredVec3() const
nkMaths::IntVector::_x
int _x
X component of the vector.
Definition: IntVector.h:375
nkMaths::IntVector::getX
int getX() const
nkMaths::IntVector::_z
int _z
Z component of the vector.
Definition: IntVector.h:377
nkMaths::IntVector::IntVector
IntVector() noexcept
nkMaths::IntVector::setX
void setX(int value)
nkMaths::IntVector::setZ
void setZ(int value)
nkMaths::IntVector::getLengthSquaredVec2
float getLengthSquaredVec2() const
nkMaths::IntVector::_y
int _y
Y component of the vector.
Definition: IntVector.h:376
nkMaths::IntVector::fromString
IntVector & fromString(nkMemory::StringView str)
nkMaths::IntVector::setY
void setY(int value)
nkMaths::IntVector::getDistanceSquaredVec3
float getDistanceSquaredVec3(const IntVector &other) const
nkMaths::IntVector::multY
void multY(int value)
nkMaths::IntVector::getLengthVec3
float getLengthVec3() const
nkMaths::Vector
A 4-component vector class, with floats.
Definition: Vector.h:12
nkMaths::IntVector::getW
int getW() const
nkMemory
Encompasses all API of component NilkinsMemory.
Definition: Allocator.h:7