implement unary negative on vectors
This commit is contained in:
@@ -158,3 +158,8 @@ void Vector3d::normalize() noexcept
|
||||
y *= inv;
|
||||
z *= inv;
|
||||
}
|
||||
|
||||
Vector3d Vector3d::operator-() const noexcept
|
||||
{
|
||||
return Vector3d(-x, -y, -z);
|
||||
}
|
||||
|
||||
@@ -24,6 +24,7 @@ public:
|
||||
Vector3d normalized() const noexcept;
|
||||
void normalize() noexcept;
|
||||
|
||||
Vector3d operator-() const noexcept;
|
||||
Vector3d& operator=(const Vector3d& other) noexcept;
|
||||
Vector3d& operator=(Vector3d&& other) noexcept;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user