mirror of
https://github.com/godotengine/godot.git
synced 2026-01-03 18:11:19 +03:00
Implement Vector2i/3i/4i methods: distance_to and distance_squared_to
This commit is contained in:
@@ -87,6 +87,12 @@ TEST_CASE("[Vector2i] Length methods") {
|
||||
CHECK_MESSAGE(
|
||||
vector2.length() == doctest::Approx(36.05551275463989293119),
|
||||
"Vector2i length should work as expected.");
|
||||
CHECK_MESSAGE(
|
||||
vector1.distance_squared_to(vector2) == 500,
|
||||
"Vector2i distance_squared_to should work as expected and return exact result.");
|
||||
CHECK_MESSAGE(
|
||||
vector1.distance_to(vector2) == doctest::Approx(22.36067977499789696409),
|
||||
"Vector2i distance_to should work as expected.");
|
||||
}
|
||||
|
||||
TEST_CASE("[Vector2i] Operators") {
|
||||
|
||||
@@ -90,6 +90,12 @@ TEST_CASE("[Vector3i] Length methods") {
|
||||
CHECK_MESSAGE(
|
||||
vector2.length() == doctest::Approx(53.8516480713450403125),
|
||||
"Vector3i length should work as expected.");
|
||||
CHECK_MESSAGE(
|
||||
vector1.distance_squared_to(vector2) == 1400,
|
||||
"Vector3i distance_squared_to should work as expected and return exact result.");
|
||||
CHECK_MESSAGE(
|
||||
vector1.distance_to(vector2) == doctest::Approx(37.41657386773941385584),
|
||||
"Vector3i distance_to should work as expected.");
|
||||
}
|
||||
|
||||
TEST_CASE("[Vector3i] Operators") {
|
||||
|
||||
@@ -90,6 +90,12 @@ TEST_CASE("[Vector4i] Length methods") {
|
||||
CHECK_MESSAGE(
|
||||
vector2.length() == doctest::Approx(73.4846922835),
|
||||
"Vector4i length should work as expected.");
|
||||
CHECK_MESSAGE(
|
||||
vector1.distance_squared_to(vector2) == 3000,
|
||||
"Vector4i distance_squared_to should work as expected.");
|
||||
CHECK_MESSAGE(
|
||||
vector1.distance_to(vector2) == doctest::Approx(54.772255750517),
|
||||
"Vector4i distance_to should work as expected.");
|
||||
}
|
||||
|
||||
TEST_CASE("[Vector4i] Operators") {
|
||||
|
||||
Reference in New Issue
Block a user