summaryrefslogtreecommitdiff
path: root/servers/physics_3d/physics_server_3d_sw.cpp
diff options
context:
space:
mode:
authorPouleyKetchoupp <pouleyketchoup@gmail.com>2021-06-22 16:36:43 -0700
committerPouleyKetchoupp <pouleyketchoup@gmail.com>2021-06-22 16:51:47 -0700
commita65cdca8947c51f4a68032b76e0b970e7fcf1d93 (patch)
treef417a45751c351b1a53a64622df0606417d1b913 /servers/physics_3d/physics_server_3d_sw.cpp
parent92f20fd70e6957cd65ccb7837fdc28f9b1e4a315 (diff)
Fix and clean disabled shapes handling in godot physics servers
In 3D, disabled shapes are now not added to the broadphase anymore. Since they are removed right away when disabled, no need to check for disabled shapes for any query that comes from the broadphase. Also Fixes raycast queries returning disabled shapes. In 2D, disabled shapes where already not added to the broadphase. Remove the same unnecessary checks as in 3D. Overall harmonized API for disabled shapes in the physics servers and removed duplicate method.
Diffstat (limited to 'servers/physics_3d/physics_server_3d_sw.cpp')
-rw-r--r--servers/physics_3d/physics_server_3d_sw.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/servers/physics_3d/physics_server_3d_sw.cpp b/servers/physics_3d/physics_server_3d_sw.cpp
index 7a95a8abc8..f26129a404 100644
--- a/servers/physics_3d/physics_server_3d_sw.cpp
+++ b/servers/physics_3d/physics_server_3d_sw.cpp
@@ -335,7 +335,7 @@ void PhysicsServer3DSW::area_set_shape_disabled(RID p_area, int p_shape_idx, boo
ERR_FAIL_COND(!area);
ERR_FAIL_INDEX(p_shape_idx, area->get_shape_count());
FLUSH_QUERY_CHECK(area);
- area->set_shape_as_disabled(p_shape_idx, p_disabled);
+ area->set_shape_disabled(p_shape_idx, p_disabled);
}
void PhysicsServer3DSW::area_attach_object_instance_id(RID p_area, ObjectID p_id) {
@@ -537,7 +537,7 @@ void PhysicsServer3DSW::body_set_shape_disabled(RID p_body, int p_shape_idx, boo
ERR_FAIL_INDEX(p_shape_idx, body->get_shape_count());
FLUSH_QUERY_CHECK(body);
- body->set_shape_as_disabled(p_shape_idx, p_disabled);
+ body->set_shape_disabled(p_shape_idx, p_disabled);
}
Transform3D PhysicsServer3DSW::body_get_shape_transform(RID p_body, int p_shape_idx) const {