From 74aeab53854b8e666136921fcd5e3bebe71e2e75 Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Tue, 16 Apr 2024 18:26:46 +0200 Subject: [PATCH] Increase size of WorldBoundaryShape to be much larger The size was previously 20,000 pixels or units, which could be easily reached in many projects. It is now 2,000,000,000,000,000 pixels or units, which is larger than the supported coordinate space with a single-precision build, and still very large in a double precision build. --- servers/physics_2d/godot_shape_2d.cpp | 2 +- servers/physics_3d/godot_shape_3d.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/servers/physics_2d/godot_shape_2d.cpp b/servers/physics_2d/godot_shape_2d.cpp index db5e6b23535e..d77b1a77e386 100644 --- a/servers/physics_2d/godot_shape_2d.cpp +++ b/servers/physics_2d/godot_shape_2d.cpp @@ -123,7 +123,7 @@ void GodotWorldBoundaryShape2D::set_data(const Variant &p_data) { ERR_FAIL_COND(arr.size() != 2); normal = arr[0]; d = arr[1]; - configure(Rect2(Vector2(-1e4, -1e4), Vector2(1e4 * 2, 1e4 * 2))); + configure(Rect2(Vector2(-1e15, -1e15), Vector2(1e15 * 2, 1e15 * 2))); } Variant GodotWorldBoundaryShape2D::get_data() const { diff --git a/servers/physics_3d/godot_shape_3d.cpp b/servers/physics_3d/godot_shape_3d.cpp index ea389ff59cd5..6eb983d5e0c8 100644 --- a/servers/physics_3d/godot_shape_3d.cpp +++ b/servers/physics_3d/godot_shape_3d.cpp @@ -152,7 +152,7 @@ Vector3 GodotWorldBoundaryShape3D::get_moment_of_inertia(real_t p_mass) const { void GodotWorldBoundaryShape3D::_setup(const Plane &p_plane) { plane = p_plane; - configure(AABB(Vector3(-1e4, -1e4, -1e4), Vector3(1e4 * 2, 1e4 * 2, 1e4 * 2))); + configure(AABB(Vector3(-1e15, -1e15, -1e15), Vector3(1e15 * 2, 1e15 * 2, 1e15 * 2))); } void GodotWorldBoundaryShape3D::set_data(const Variant &p_data) {