diff options
author | PouleyKetchoupp <pouleyketchoup@gmail.com> | 2021-10-01 08:02:38 -0700 |
---|---|---|
committer | PouleyKetchoupp <pouleyketchoup@gmail.com> | 2021-10-01 08:02:38 -0700 |
commit | ca30b70943b1d2c19c10e901786edb8b095f7834 (patch) | |
tree | 9a6aa312895bd7ac1cf2281444537e2f9c31a64e | |
parent | 77721b35ba21f2e7e8bb42cf415fccb018517843 (diff) |
Remove editor code in PhysicalBone3D
_set_gizmo_move_joint is only used in PhysicalBone3DEditor, so the
editor plugin call can be done directly there.
-rw-r--r-- | editor/plugins/physical_bone_3d_editor_plugin.cpp | 1 | ||||
-rw-r--r-- | scene/3d/physics_body_3d.cpp | 9 | ||||
-rw-r--r-- | scene/3d/physics_body_3d.h | 3 |
3 files changed, 3 insertions, 10 deletions
diff --git a/editor/plugins/physical_bone_3d_editor_plugin.cpp b/editor/plugins/physical_bone_3d_editor_plugin.cpp index f92f50f826..b1e104e680 100644 --- a/editor/plugins/physical_bone_3d_editor_plugin.cpp +++ b/editor/plugins/physical_bone_3d_editor_plugin.cpp @@ -43,6 +43,7 @@ void PhysicalBone3DEditor::_on_toggle_button_transform_joint(bool p_is_pressed) void PhysicalBone3DEditor::_set_move_joint() { if (selected) { selected->_set_gizmo_move_joint(button_transform_joint->is_pressed()); + Node3DEditor::get_singleton()->update_transform_gizmo(); } } diff --git a/scene/3d/physics_body_3d.cpp b/scene/3d/physics_body_3d.cpp index 8603d15162..6e8eef1a44 100644 --- a/scene/3d/physics_body_3d.cpp +++ b/scene/3d/physics_body_3d.cpp @@ -33,10 +33,6 @@ #include "core/core_string_names.h" #include "scene/scene_string_names.h" -#ifdef TOOLS_ENABLED -#include "editor/plugins/node_3d_editor_plugin.h" -#endif - void PhysicsBody3D::_bind_methods() { ClassDB::bind_method(D_METHOD("move_and_collide", "linear_velocity", "test_only", "safe_margin", "max_collisions"), &PhysicsBody3D::_move, DEFVAL(false), DEFVAL(0.001), DEFVAL(1)); ClassDB::bind_method(D_METHOD("test_move", "from", "linear_velocity", "collision", "safe_margin", "max_collisions"), &PhysicsBody3D::test_move, DEFVAL(Variant()), DEFVAL(0.001), DEFVAL(1)); @@ -2998,14 +2994,11 @@ void PhysicalBone3D::_on_bone_parent_changed() { _reload_joint(); } -void PhysicalBone3D::_set_gizmo_move_joint(bool p_move_joint) { #ifdef TOOLS_ENABLED +void PhysicalBone3D::_set_gizmo_move_joint(bool p_move_joint) { gizmo_move_joint = p_move_joint; - Node3DEditor::get_singleton()->update_transform_gizmo(); -#endif } -#ifdef TOOLS_ENABLED Transform3D PhysicalBone3D::get_global_gizmo_transform() const { return gizmo_move_joint ? get_global_transform() * joint_offset : get_global_transform(); } diff --git a/scene/3d/physics_body_3d.h b/scene/3d/physics_body_3d.h index 916b2cd464..f8669c870a 100644 --- a/scene/3d/physics_body_3d.h +++ b/scene/3d/physics_body_3d.h @@ -662,10 +662,9 @@ private: public: void _on_bone_parent_changed(); - void _set_gizmo_move_joint(bool p_move_joint); -public: #ifdef TOOLS_ENABLED + void _set_gizmo_move_joint(bool p_move_joint); virtual Transform3D get_global_gizmo_transform() const override; virtual Transform3D get_local_gizmo_transform() const override; #endif |