mirror of
https://github.com/orange-cpp/omath.git
synced 2026-02-13 15:03:27 +00:00
added 2 methods
This commit is contained in:
@@ -210,4 +210,23 @@ namespace uml
|
||||
0.f
|
||||
};
|
||||
}
|
||||
|
||||
Vector3 Vector3::Cross(const Vector3 &v) const
|
||||
{
|
||||
return {
|
||||
y * v.z - z * v.y,
|
||||
z * v.x - x * v.z,
|
||||
x * v.y - y * v.x
|
||||
};
|
||||
}
|
||||
|
||||
Vector3 Vector3::Normalized() const
|
||||
{
|
||||
float length = this->Length();
|
||||
if (length != 0)
|
||||
{
|
||||
return *this / length;
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user