summaryrefslogtreecommitdiff
path: root/modules/csg/csg_shape.cpp
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2021-02-10 17:39:53 +0100
committerGitHub <noreply@github.com>2021-02-10 17:39:53 +0100
commit1808f1d76d51b67513c0cd864444f20ecf808601 (patch)
tree19bf66787e48cebd86b494846d147db1f163f87c /modules/csg/csg_shape.cpp
parentf3d15771bf33e68b26058806f9310ac074c56e5c (diff)
parent8b19ffd810a1471ab870b7229047ad2101341330 (diff)
Merge pull request #45852 from reduz/make-servers-truly-thread-safe
Make Servers truly Thread Safe
Diffstat (limited to 'modules/csg/csg_shape.cpp')
-rw-r--r--modules/csg/csg_shape.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/modules/csg/csg_shape.cpp b/modules/csg/csg_shape.cpp
index 82d3ac8b1b..542e354ccc 100644
--- a/modules/csg/csg_shape.cpp
+++ b/modules/csg/csg_shape.cpp
@@ -45,7 +45,8 @@ void CSGShape3D::set_use_collision(bool p_enable) {
if (use_collision) {
root_collision_shape.instance();
- root_collision_instance = PhysicsServer3D::get_singleton()->body_create(PhysicsServer3D::BODY_MODE_STATIC);
+ root_collision_instance = PhysicsServer3D::get_singleton()->body_create();
+ PhysicsServer3D::get_singleton()->body_set_mode(root_collision_instance, PhysicsServer3D::BODY_MODE_STATIC);
PhysicsServer3D::get_singleton()->body_set_state(root_collision_instance, PhysicsServer3D::BODY_STATE_TRANSFORM, get_global_transform());
PhysicsServer3D::get_singleton()->body_add_shape(root_collision_instance, root_collision_shape->get_rid());
PhysicsServer3D::get_singleton()->body_set_space(root_collision_instance, get_world_3d()->get_space());
@@ -494,7 +495,8 @@ void CSGShape3D::_notification(int p_what) {
if (use_collision && is_root_shape()) {
root_collision_shape.instance();
- root_collision_instance = PhysicsServer3D::get_singleton()->body_create(PhysicsServer3D::BODY_MODE_STATIC);
+ root_collision_instance = PhysicsServer3D::get_singleton()->body_create();
+ PhysicsServer3D::get_singleton()->body_set_mode(root_collision_instance, PhysicsServer3D::BODY_MODE_STATIC);
PhysicsServer3D::get_singleton()->body_set_state(root_collision_instance, PhysicsServer3D::BODY_STATE_TRANSFORM, get_global_transform());
PhysicsServer3D::get_singleton()->body_add_shape(root_collision_instance, root_collision_shape->get_rid());
PhysicsServer3D::get_singleton()->body_set_space(root_collision_instance, get_world_3d()->get_space());