A 4-component vector class, with integers.
More...
|
int | _x |
| X component of the vector.
|
|
int | _y |
| Y component of the vector.
|
|
int | _z |
| Z component of the vector.
|
|
int | _w |
| W component of the vector.
|
|
A 4-component vector class, with integers.
◆ IntVector() [1/6]
nkMaths::IntVector::IntVector |
( |
| ) |
|
|
noexcept |
Default constructor. Defaults to 0 on each component.
◆ IntVector() [2/6]
nkMaths::IntVector::IntVector |
( |
int |
x, |
|
|
int |
y |
|
) |
| |
|
noexcept |
2D constructor.
- Parameters
-
x | The x component to assign. |
y | The y component to assign. |
◆ IntVector() [3/6]
nkMaths::IntVector::IntVector |
( |
int |
x, |
|
|
int |
y, |
|
|
int |
z |
|
) |
| |
|
noexcept |
3D constructor.
- Parameters
-
x | The x component to assign. |
y | The y component to assign. |
z | The z component to assign. |
◆ IntVector() [4/6]
nkMaths::IntVector::IntVector |
( |
int |
x, |
|
|
int |
y, |
|
|
int |
z, |
|
|
int |
w |
|
) |
| |
|
noexcept |
4D constructor.
- Parameters
-
x | The x component to assign. |
y | The y component to assign. |
z | The z component to assign. |
w | The w component to assign. |
◆ IntVector() [5/6]
nkMaths::IntVector::IntVector |
( |
const Vector & |
other | ) |
|
|
noexcept |
Copy constructor.
- Parameters
-
other | The vector to copy from. |
◆ IntVector() [6/6]
nkMaths::IntVector::IntVector |
( |
const IntVector & |
other | ) |
|
|
noexcept |
Copy constructor.
- Parameters
-
other | The vector to copy from. |
◆ getX()
int nkMaths::IntVector::getX |
( |
| ) |
const |
◆ getY()
int nkMaths::IntVector::getY |
( |
| ) |
const |
◆ getZ()
int nkMaths::IntVector::getZ |
( |
| ) |
const |
◆ getW()
int nkMaths::IntVector::getW |
( |
| ) |
const |
◆ setX()
void nkMaths::IntVector::setX |
( |
int |
value | ) |
|
Sets the x component.
- Parameters
-
◆ setY()
void nkMaths::IntVector::setY |
( |
int |
value | ) |
|
Sets the y component.
- Parameters
-
◆ setZ()
void nkMaths::IntVector::setZ |
( |
int |
value | ) |
|
Sets the z component.
- Parameters
-
◆ setW()
void nkMaths::IntVector::setW |
( |
int |
value | ) |
|
Sets the w component.
- Parameters
-
◆ addX()
void nkMaths::IntVector::addX |
( |
int |
value | ) |
|
Adds to the x component.
- Parameters
-
◆ addY()
void nkMaths::IntVector::addY |
( |
int |
value | ) |
|
Adds to the y component.
- Parameters
-
◆ addZ()
void nkMaths::IntVector::addZ |
( |
int |
value | ) |
|
Adds to the z component.
- Parameters
-
◆ addW()
void nkMaths::IntVector::addW |
( |
int |
value | ) |
|
Adds to the w component.
- Parameters
-
◆ multX()
void nkMaths::IntVector::multX |
( |
int |
value | ) |
|
Multiply the x component.
- Parameters
-
value | The value to multiply. |
◆ multY()
void nkMaths::IntVector::multY |
( |
int |
value | ) |
|
Multiply the y component.
- Parameters
-
value | The value to multiply. |
◆ multZ()
void nkMaths::IntVector::multZ |
( |
int |
value | ) |
|
Multiply the z component.
- Parameters
-
value | The value to multiply. |
◆ multW()
void nkMaths::IntVector::multW |
( |
int |
value | ) |
|
Multiply the w component.
- Parameters
-
value | The value to multiply. |
◆ getLengthVec2()
float nkMaths::IntVector::getLengthVec2 |
( |
| ) |
const |
- Returns
- The length of the vector, as if it was a 2D vector.
◆ getLengthVec3()
float nkMaths::IntVector::getLengthVec3 |
( |
| ) |
const |
- Returns
- The length of the vector, as if it was a 3D vector.
◆ getLengthVec4()
float nkMaths::IntVector::getLengthVec4 |
( |
| ) |
const |
- Returns
- The length of the vector, as if it was a 4D vector.
◆ getLengthSquaredVec2()
float nkMaths::IntVector::getLengthSquaredVec2 |
( |
| ) |
const |
- Returns
- The squared length of the vector as if it was a 2D vector.
◆ getLengthSquaredVec3()
float nkMaths::IntVector::getLengthSquaredVec3 |
( |
| ) |
const |
- Returns
- The squared length of the vector as if it was a 3D vector.
◆ getLengthSquaredVec4()
float nkMaths::IntVector::getLengthSquaredVec4 |
( |
| ) |
const |
- Returns
- The squared length of the vector as if it was a 4D vector.
◆ getDistanceVec2()
float nkMaths::IntVector::getDistanceVec2 |
( |
const IntVector & |
other | ) |
const |
- Parameters
-
other | The vector to check the distance with. |
- Returns
- The distance between both vectors, as if they were 2D vectors.
◆ getDistanceVec3()
float nkMaths::IntVector::getDistanceVec3 |
( |
const IntVector & |
other | ) |
const |
- Parameters
-
other | The vector to check the distance with. |
- Returns
- The distance between both vectors, as if they were 3D vectors.
◆ getDistanceVec4()
float nkMaths::IntVector::getDistanceVec4 |
( |
const IntVector & |
other | ) |
const |
- Parameters
-
other | The vector to check the distance with. |
- Returns
- The distance between both vectors, as if they were 4D vectors.
◆ getDistanceSquaredVec2()
float nkMaths::IntVector::getDistanceSquaredVec2 |
( |
const IntVector & |
other | ) |
const |
- Parameters
-
other | The vector to check the distance with. |
- Returns
- The squared distance between both vectors, as if they were 2D vectors.
◆ getDistanceSquaredVec3()
float nkMaths::IntVector::getDistanceSquaredVec3 |
( |
const IntVector & |
other | ) |
const |
- Parameters
-
other | The vector to check the distance with. |
- Returns
- The squared distance between both vectors, as if they were 3D vectors.
◆ getDistanceSquaredVec4()
float nkMaths::IntVector::getDistanceSquaredVec4 |
( |
const IntVector & |
other | ) |
const |
- Parameters
-
other | The vector to check the distance with. |
- Returns
- The squared distance between both vectors, as if they were 4D vectors.
◆ toString()
- Returns
- The vector expressed as a string, formatted as "x, y, z, w".
◆ fromString()
Parse components from a string representation. Format is "x,y,z,w".
- Parameters
-
◆ operator=() [1/2]
Assignment operator.
- Parameters
-
other | The vector to overwrite from. |
- Returns
- The calling vector, updated.
◆ operator=() [2/2]
Assignment operator.
- Parameters
-
other | The vector to overwrite from. |
- Returns
- The calling vector, updated.
◆ operator+()
Addition operator.
- Parameters
-
other | The vector to operate with. |
- Returns
- A result vector, after operation application.
◆ operator+=()
void nkMaths::IntVector::operator+= |
( |
const IntVector & |
other | ) |
|
Addition and assignment operator.
- Parameters
-
other | The vector to operate with. |
◆ operator-()
Subtraction operator.
- Parameters
-
other | The vector to operate with. |
- Returns
- A result vector, after operation application.
◆ operator-=()
void nkMaths::IntVector::operator-= |
( |
const IntVector & |
other | ) |
|
Subtraction and assignment operator.
- Parameters
-
other | The vector to operate with. |
◆ operator*() [1/2]
Multiplication operator.
- Parameters
-
other | The vector to operate with. |
- Returns
- A result vector, after operation application.
◆ operator*=() [1/2]
void nkMaths::IntVector::operator*= |
( |
const IntVector & |
other | ) |
|
Multiplication and assignment operator.
- Parameters
-
other | The vector to operate with. |
◆ operator*() [2/2]
IntVector nkMaths::IntVector::operator* |
( |
int |
coeff | ) |
const |
Multiplication operator.
- Parameters
-
coeff | The scalar to operate with. |
- Returns
- A result vector, after operation application on all components.
◆ operator*=() [2/2]
void nkMaths::IntVector::operator*= |
( |
int |
coeff | ) |
|
Multiplication and assignment operator.
- Parameters
-
coeff | The scalar to operate with. |
◆ operator/() [1/2]
Division operator.
- Parameters
-
other | The vector to operate with. |
- Returns
- A result vector, after operation application.
◆ operator/=() [1/2]
void nkMaths::IntVector::operator/= |
( |
const IntVector & |
other | ) |
|
Division and assignment operator.
- Parameters
-
other | The vector to operate with. |
◆ operator/() [2/2]
IntVector nkMaths::IntVector::operator/ |
( |
int |
coeff | ) |
const |
Division operator.
- Parameters
-
coeff | The scalar to operate with. |
- Returns
- A result vector, after operation application on all components.
◆ operator/=() [2/2]
void nkMaths::IntVector::operator/= |
( |
int |
coeff | ) |
|
Division and assignment operator.
- Parameters
-
coeff | The scalar to operate with. |
◆ operator==()
bool nkMaths::IntVector::operator== |
( |
const IntVector & |
other | ) |
const |
Equality operator.
- Parameters
-
other | The vector to check against. |
- Returns
- If the vectors are equal (true) or not (false).
◆ operator!=()
bool nkMaths::IntVector::operator!= |
( |
const IntVector & |
other | ) |
const |
Inequality operator.
- Parameters
-
other | The vector to check against. |
- Returns
- If the vectors are inequal (true) or not (false).
◆ operator<()
bool nkMaths::IntVector::operator< |
( |
const IntVector & |
other | ) |
const |
Less than operator.
- Parameters
-
other | The vector to check against. |
- Returns
- If the calling vector is smaller (true) or not (false).
◆ operator<=()
bool nkMaths::IntVector::operator<= |
( |
const IntVector & |
other | ) |
const |
Less than or equal operator.
- Parameters
-
other | The vector to check against. |
- Returns
- If the calling vector is smaller, equal (true) or not (false).
◆ operator>()
bool nkMaths::IntVector::operator> |
( |
const IntVector & |
other | ) |
const |
Greater than operator.
- Parameters
-
other | The vector to check against. |
- Returns
- If the calling vector is greater (true) or not (false).
◆ operator>=()
bool nkMaths::IntVector::operator>= |
( |
const IntVector & |
other | ) |
const |
Greater than or equal operator.
- Parameters
-
other | The vector to check against. |
- Returns
- If the calling vector is greater, equal (true) or not (false).
The documentation for this class was generated from the following file: