diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2022-01-26 13:26:44 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-26 13:26:44 +0100 |
commit | 5eaa93e6b06c6476d2e87c7c681e4abac750181a (patch) | |
tree | 9450e787785127d3720353225c3ab4f6e09cf5c2 /scene/3d | |
parent | d289448346a161a55e97efd09fd9b55d33dc346a (diff) | |
parent | a77574474211957a050d7cd48b44eb32a254350e (diff) |
Merge pull request #57182 from timothyqiu/shape-owner
Diffstat (limited to 'scene/3d')
-rw-r--r-- | scene/3d/collision_object_3d.cpp | 4 | ||||
-rw-r--r-- | scene/3d/collision_object_3d.h | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/scene/3d/collision_object_3d.cpp b/scene/3d/collision_object_3d.cpp index df7c044f9e..3ab09550fa 100644 --- a/scene/3d/collision_object_3d.cpp +++ b/scene/3d/collision_object_3d.cpp @@ -484,7 +484,7 @@ uint32_t CollisionObject3D::create_shape_owner(Object *p_owner) { id = shapes.back()->key() + 1; } - sd.owner = p_owner; + sd.owner_id = p_owner ? p_owner->get_instance_id() : ObjectID(); shapes[id] = sd; @@ -563,7 +563,7 @@ Transform3D CollisionObject3D::shape_owner_get_transform(uint32_t p_owner) const Object *CollisionObject3D::shape_owner_get_owner(uint32_t p_owner) const { ERR_FAIL_COND_V(!shapes.has(p_owner), nullptr); - return shapes[p_owner].owner; + return ObjectDB::get_instance(shapes[p_owner].owner_id); } void CollisionObject3D::shape_owner_add_shape(uint32_t p_owner, const Ref<Shape3D> &p_shape) { diff --git a/scene/3d/collision_object_3d.h b/scene/3d/collision_object_3d.h index f560753543..e92843d784 100644 --- a/scene/3d/collision_object_3d.h +++ b/scene/3d/collision_object_3d.h @@ -57,7 +57,7 @@ private: PhysicsServer3D::BodyMode body_mode = PhysicsServer3D::BODY_MODE_STATIC; struct ShapeData { - Object *owner = nullptr; + ObjectID owner_id; Transform3D xform; struct ShapeBase { RID debug_shape; |