From d83f28c729e1fda8fac3b19446827df76ca8dc1b Mon Sep 17 00:00:00 2001 From: The-Cyber-Captain Date: Fri, 24 Oct 2025 18:09:18 +0100 Subject: [PATCH] Exposes joint_rid based on Riordan-DCs approach. --- doc/classes/PhysicalBone3D.xml | 6 ++++++ scene/3d/physics/physical_bone_3d.cpp | 2 ++ scene/3d/physics/physical_bone_3d.h | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/doc/classes/PhysicalBone3D.xml b/doc/classes/PhysicalBone3D.xml index 60c5881b55..896378898b 100644 --- a/doc/classes/PhysicalBone3D.xml +++ b/doc/classes/PhysicalBone3D.xml @@ -42,6 +42,12 @@ Returns the unique identifier of the PhysicsBone3D. + + + + Returns the joint's internal [RID] from the [PhysicsServer3D]. + + diff --git a/scene/3d/physics/physical_bone_3d.cpp b/scene/3d/physics/physical_bone_3d.cpp index 41ebadf9fd..cb2ccc9cff 100644 --- a/scene/3d/physics/physical_bone_3d.cpp +++ b/scene/3d/physics/physical_bone_3d.cpp @@ -835,6 +835,8 @@ void PhysicalBone3D::_bind_methods() { ClassDB::bind_method(D_METHOD("set_joint_type", "joint_type"), &PhysicalBone3D::set_joint_type); ClassDB::bind_method(D_METHOD("get_joint_type"), &PhysicalBone3D::get_joint_type); + ClassDB::bind_method(D_METHOD("get_joint_rid"), &PhysicalBone3D::get_joint_rid); + ClassDB::bind_method(D_METHOD("set_joint_offset", "offset"), &PhysicalBone3D::set_joint_offset); ClassDB::bind_method(D_METHOD("get_joint_offset"), &PhysicalBone3D::get_joint_offset); ClassDB::bind_method(D_METHOD("set_joint_rotation", "euler"), &PhysicalBone3D::set_joint_rotation); diff --git a/scene/3d/physics/physical_bone_3d.h b/scene/3d/physics/physical_bone_3d.h index 4ccbb02782..3223506bef 100644 --- a/scene/3d/physics/physical_bone_3d.h +++ b/scene/3d/physics/physical_bone_3d.h @@ -239,6 +239,10 @@ public: return bone_id; } + RID get_joint_rid() const { + return joint; + } + void set_joint_type(JointType p_joint_type); JointType get_joint_type() const;