1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-13 13:31:48 +00:00

Add is_zero_approx methods to Vector{2,3}

This commit is contained in:
Haoyu Qiu
2024-04-10 19:02:42 +08:00
parent 2b97d143a2
commit ed952f82bd
12 changed files with 34 additions and 6 deletions

View File

@@ -151,6 +151,10 @@ bool Vector3::is_equal_approx(const Vector3 &p_v) const {
return Math::is_equal_approx(x, p_v.x) && Math::is_equal_approx(y, p_v.y) && Math::is_equal_approx(z, p_v.z);
}
bool Vector3::is_zero_approx() const {
return Math::is_zero_approx(x) && Math::is_zero_approx(y) && Math::is_zero_approx(z);
}
Vector3::operator String() const {
return (rtos(x) + ", " + rtos(y) + ", " + rtos(z));
}