From 24985b9fb813bc8220b78e0bb9b3b3bb9ca61e7c Mon Sep 17 00:00:00 2001 From: Ryan <73148864+Ryan-000@users.noreply.github.com> Date: Fri, 26 Jul 2024 06:31:46 +0000 Subject: [PATCH] Expose physics RID --- src/terrain_3d.cpp | 1 + src/terrain_3d.h | 1 + 2 files changed, 2 insertions(+) diff --git a/src/terrain_3d.cpp b/src/terrain_3d.cpp index bfb3f9815..e99a80b03 100644 --- a/src/terrain_3d.cpp +++ b/src/terrain_3d.cpp @@ -1259,6 +1259,7 @@ void Terrain3D::_bind_methods() { ClassDB::bind_method(D_METHOD("get_collision_mask"), &Terrain3D::get_collision_mask); ClassDB::bind_method(D_METHOD("set_collision_priority", "priority"), &Terrain3D::set_collision_priority); ClassDB::bind_method(D_METHOD("get_collision_priority"), &Terrain3D::get_collision_priority); + ClassDB::bind_method(D_METHOD("get_rid"), &Terrain3D::get_rid); ClassDB::bind_method(D_METHOD("get_intersection", "src_pos", "direction"), &Terrain3D::get_intersection); ClassDB::bind_method(D_METHOD("bake_mesh", "lod", "filter"), &Terrain3D::bake_mesh); diff --git a/src/terrain_3d.h b/src/terrain_3d.h index e88880a38..dbed98c78 100644 --- a/src/terrain_3d.h +++ b/src/terrain_3d.h @@ -154,6 +154,7 @@ class Terrain3D : public Node3D { uint32_t get_collision_mask() const { return _collision_mask; }; void set_collision_priority(const real_t p_priority); real_t get_collision_priority() const { return _collision_priority; } + RID get_rid() const { return _static_body; }; // Terrain methods void snap(const Vector3 &p_cam_pos);