implement unary negative on vectors
This commit is contained in:
1 parent
9b3caf511c
commit
e87653ab47
2 files changed
+6
No files matched your search
@@ -158,3 +158,8 @@ void Vector3d::normalize() noexcept
|
|||||||
y *= inv;
|
y *= inv;
|
||||||
z *= inv;
|
z *= inv;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Vector3d Vector3d::operator-() const noexcept
|
||||||
|
{
|
||||||
|
return Vector3d(-x, -y, -z);
|
||||||
|
}
|
||||||
@@ -24,6 +24,7 @@ public:
|
|||||||
Vector3d normalized() const noexcept;
|
Vector3d normalized() const noexcept;
|
||||||
void normalize() noexcept;
|
void normalize() noexcept;
|
||||||
|
|
||||||
|
Vector3d operator-() const noexcept;
|
||||||
Vector3d& operator=(const Vector3d& other) noexcept;
|
Vector3d& operator=(const Vector3d& other) noexcept;
|
||||||
Vector3d& operator=(Vector3d&& other) noexcept;
|
Vector3d& operator=(Vector3d&& other) noexcept;
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user