This commit is contained in:
Saikari
2025-12-21 22:22:18 +03:00
parent 1499ac3213
commit 4a8e7e85ce
3 changed files with 14 additions and 4 deletions

View File

@@ -233,10 +233,10 @@ namespace omath
return Angle<float, 0.f, 180.f, AngleFlags::Clamped>::from_radians(std::acos(dot(other) / bottom));
}
[[nodiscard]] bool is_perpendicular(const Vector3& other) const noexcept
[[nodiscard]] bool is_perpendicular(const Vector3& other, Type epsilon = static_cast<Type>(0.0001)) const noexcept
{
if (const auto angle = angle_between(other))
return angle->as_degrees() == static_cast<Type>(90);
return std::abs(angle->as_degrees() - static_cast<Type>(90)) <= epsilon;
return false;
}