mirror of
https://github.com/DarkflameUniverse/DarkflameServer
synced 2024-08-30 18:43:58 +00:00
add operator *= for vectors
This commit is contained in:
parent
fe6be21008
commit
ad81e341da
@ -136,6 +136,13 @@ NiPoint3& NiPoint3::operator+=(const NiPoint3& point) {
|
|||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
NiPoint3& NiPoint3::operator*=(const float scalar) {
|
||||||
|
this->x *= scalar;
|
||||||
|
this->y *= scalar;
|
||||||
|
this->z *= scalar;
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
//! Operator for subtraction of vectors
|
//! Operator for subtraction of vectors
|
||||||
NiPoint3 NiPoint3::operator-(const NiPoint3& point) const {
|
NiPoint3 NiPoint3::operator-(const NiPoint3& point) const {
|
||||||
return NiPoint3(this->x - point.x, this->y - point.y, this->z - point.z);
|
return NiPoint3(this->x - point.x, this->y - point.y, this->z - point.z);
|
||||||
|
@ -138,6 +138,8 @@ public:
|
|||||||
//! Operator for addition of vectors
|
//! Operator for addition of vectors
|
||||||
NiPoint3& operator+=(const NiPoint3& point);
|
NiPoint3& operator+=(const NiPoint3& point);
|
||||||
|
|
||||||
|
NiPoint3& operator*=(const float scalar);
|
||||||
|
|
||||||
//! Operator for subtraction of vectors
|
//! Operator for subtraction of vectors
|
||||||
NiPoint3 operator-(const NiPoint3& point) const;
|
NiPoint3 operator-(const NiPoint3& point) const;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user