Skip to content

Commit

Permalink
Merge pull request #88862 from smix8/split_physics_classes
Browse files Browse the repository at this point in the history
Split monolithic physics class files
  • Loading branch information
akien-mga committed Feb 27, 2024
2 parents 9dceb62 + 35dafc9 commit 21e3b21
Show file tree
Hide file tree
Showing 132 changed files with 9,664 additions and 8,316 deletions.
9 changes: 5 additions & 4 deletions editor/import/3d/resource_importer_scene.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,15 @@
#include "editor/editor_node.h"
#include "editor/editor_settings.h"
#include "editor/import/3d/scene_import_settings.h"
#include "scene/3d/area_3d.h"
#include "scene/3d/collision_shape_3d.h"
#include "scene/3d/importer_mesh_instance_3d.h"
#include "scene/3d/mesh_instance_3d.h"
#include "scene/3d/navigation_region_3d.h"
#include "scene/3d/occluder_instance_3d.h"
#include "scene/3d/physics_body_3d.h"
#include "scene/3d/vehicle_body_3d.h"
#include "scene/3d/physics/area_3d.h"
#include "scene/3d/physics/collision_shape_3d.h"
#include "scene/3d/physics/physics_body_3d.h"
#include "scene/3d/physics/static_body_3d.h"
#include "scene/3d/physics/vehicle_body_3d.h"
#include "scene/animation/animation_player.h"
#include "scene/resources/3d/box_shape_3d.h"
#include "scene/resources/3d/importer_mesh.h"
Expand Down
4 changes: 2 additions & 2 deletions editor/plugins/cast_2d_editor_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
#include "canvas_item_editor_plugin.h"
#include "editor/editor_node.h"
#include "editor/editor_undo_redo_manager.h"
#include "scene/2d/ray_cast_2d.h"
#include "scene/2d/shape_cast_2d.h"
#include "scene/2d/physics/ray_cast_2d.h"
#include "scene/2d/physics/shape_cast_2d.h"

void Cast2DEditor::_notification(int p_what) {
switch (p_what) {
Expand Down
2 changes: 1 addition & 1 deletion editor/plugins/collision_polygon_2d_editor_plugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
#define COLLISION_POLYGON_2D_EDITOR_PLUGIN_H

#include "editor/plugins/abstract_polygon_2d_editor.h"
#include "scene/2d/collision_polygon_2d.h"
#include "scene/2d/physics/collision_polygon_2d.h"

class CollisionPolygon2DEditor : public AbstractPolygon2DEditor {
GDCLASS(CollisionPolygon2DEditor, AbstractPolygon2DEditor);
Expand Down
2 changes: 1 addition & 1 deletion editor/plugins/collision_shape_2d_editor_plugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
#define COLLISION_SHAPE_2D_EDITOR_PLUGIN_H

#include "editor/editor_plugin.h"
#include "scene/2d/collision_shape_2d.h"
#include "scene/2d/physics/collision_shape_2d.h"

class CanvasItemEditor;

Expand Down
2 changes: 1 addition & 1 deletion editor/plugins/cpu_particles_2d_editor_plugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
#define CPU_PARTICLES_2D_EDITOR_PLUGIN_H

#include "editor/editor_plugin.h"
#include "scene/2d/collision_polygon_2d.h"
#include "scene/2d/cpu_particles_2d.h"
#include "scene/2d/physics/collision_polygon_2d.h"
#include "scene/gui/box_container.h"

class CheckBox;
Expand Down
6 changes: 3 additions & 3 deletions editor/plugins/gizmos/collision_object_3d_gizmo_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@

#include "editor/editor_settings.h"
#include "editor/plugins/node_3d_editor_plugin.h"
#include "scene/3d/collision_object_3d.h"
#include "scene/3d/collision_polygon_3d.h"
#include "scene/3d/collision_shape_3d.h"
#include "scene/3d/physics/collision_object_3d.h"
#include "scene/3d/physics/collision_polygon_3d.h"
#include "scene/3d/physics/collision_shape_3d.h"
#include "scene/resources/surface_tool.h"

CollisionObject3DGizmoPlugin::CollisionObject3DGizmoPlugin() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

#include "editor/editor_settings.h"
#include "editor/plugins/node_3d_editor_plugin.h"
#include "scene/3d/collision_polygon_3d.h"
#include "scene/3d/physics/collision_polygon_3d.h"

CollisionPolygon3DGizmoPlugin::CollisionPolygon3DGizmoPlugin() {
const Color gizmo_color = EDITOR_GET("editors/3d_gizmos/gizmo_colors/shape");
Expand Down
2 changes: 1 addition & 1 deletion editor/plugins/gizmos/collision_shape_3d_gizmo_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
#include "editor/editor_undo_redo_manager.h"
#include "editor/plugins/gizmos/gizmo_3d_helper.h"
#include "editor/plugins/node_3d_editor_plugin.h"
#include "scene/3d/collision_shape_3d.h"
#include "scene/3d/physics/collision_shape_3d.h"
#include "scene/resources/3d/box_shape_3d.h"
#include "scene/resources/3d/capsule_shape_3d.h"
#include "scene/resources/3d/concave_polygon_shape_3d.h"
Expand Down
6 changes: 5 additions & 1 deletion editor/plugins/gizmos/joint_3d_gizmo_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,11 @@
#include "editor/editor_node.h"
#include "editor/editor_settings.h"
#include "editor/plugins/node_3d_editor_plugin.h"
#include "scene/3d/joint_3d.h"
#include "scene/3d/physics/joints/cone_twist_joint_3d.h"
#include "scene/3d/physics/joints/generic_6dof_joint_3d.h"
#include "scene/3d/physics/joints/hinge_joint_3d.h"
#include "scene/3d/physics/joints/pin_joint_3d.h"
#include "scene/3d/physics/joints/slider_joint_3d.h"

#define BODY_A_RADIUS 0.25
#define BODY_B_RADIUS 0.27
Expand Down
3 changes: 2 additions & 1 deletion editor/plugins/gizmos/physics_bone_3d_gizmo_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@
#include "editor/editor_settings.h"
#include "editor/plugins/gizmos/joint_3d_gizmo_plugin.h"
#include "editor/plugins/node_3d_editor_plugin.h"
#include "scene/3d/physics_body_3d.h"
#include "scene/3d/physics/physical_bone_3d.h"
#include "scene/3d/physics/physics_body_3d.h"

PhysicalBone3DGizmoPlugin::PhysicalBone3DGizmoPlugin() {
create_material("joint_material", EDITOR_GET("editors/3d_gizmos/gizmo_colors/joint"));
Expand Down
2 changes: 1 addition & 1 deletion editor/plugins/gizmos/ray_cast_3d_gizmo_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

#include "editor/editor_settings.h"
#include "editor/plugins/node_3d_editor_plugin.h"
#include "scene/3d/ray_cast_3d.h"
#include "scene/3d/physics/ray_cast_3d.h"

RayCast3DGizmoPlugin::RayCast3DGizmoPlugin() {
const Color gizmo_color = EDITOR_GET("editors/3d_gizmos/gizmo_colors/shape");
Expand Down
2 changes: 1 addition & 1 deletion editor/plugins/gizmos/shape_cast_3d_gizmo_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

#include "editor/editor_settings.h"
#include "editor/plugins/node_3d_editor_plugin.h"
#include "scene/3d/shape_cast_3d.h"
#include "scene/3d/physics/shape_cast_3d.h"

ShapeCast3DGizmoPlugin::ShapeCast3DGizmoPlugin() {
const Color gizmo_color = EDITOR_GET("editors/3d_gizmos/gizmo_colors/shape");
Expand Down
2 changes: 1 addition & 1 deletion editor/plugins/gizmos/spring_arm_3d_gizmo_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

#include "editor/editor_settings.h"
#include "editor/plugins/node_3d_editor_plugin.h"
#include "scene/3d/spring_arm_3d.h"
#include "scene/3d/physics/spring_arm_3d.h"
#include "scene/resources/3d/shape_3d.h"

void SpringArm3DGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) {
Expand Down
2 changes: 1 addition & 1 deletion editor/plugins/gizmos/vehicle_body_3d_gizmo_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

#include "editor/editor_settings.h"
#include "editor/plugins/node_3d_editor_plugin.h"
#include "scene/3d/vehicle_body_3d.h"
#include "scene/3d/physics/vehicle_body_3d.h"

VehicleWheel3DGizmoPlugin::VehicleWheel3DGizmoPlugin() {
Color gizmo_color = EDITOR_GET("editors/3d_gizmos/gizmo_colors/shape");
Expand Down
2 changes: 1 addition & 1 deletion editor/plugins/gpu_particles_2d_editor_plugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
#define GPU_PARTICLES_2D_EDITOR_PLUGIN_H

#include "editor/editor_plugin.h"
#include "scene/2d/collision_polygon_2d.h"
#include "scene/2d/gpu_particles_2d.h"
#include "scene/2d/physics/collision_polygon_2d.h"
#include "scene/gui/box_container.h"
#include "scene/gui/spin_box.h"

Expand Down
5 changes: 3 additions & 2 deletions editor/plugins/mesh_instance_3d_editor_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,10 @@
#include "editor/editor_undo_redo_manager.h"
#include "editor/plugins/node_3d_editor_plugin.h"
#include "editor/themes/editor_scale.h"
#include "scene/3d/collision_shape_3d.h"
#include "scene/3d/navigation_region_3d.h"
#include "scene/3d/physics_body_3d.h"
#include "scene/3d/physics/collision_shape_3d.h"
#include "scene/3d/physics/physics_body_3d.h"
#include "scene/3d/physics/static_body_3d.h"
#include "scene/gui/box_container.h"
#include "scene/gui/dialogs.h"
#include "scene/gui/menu_button.h"
Expand Down
3 changes: 2 additions & 1 deletion editor/plugins/mesh_library_editor_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@
#include "main/main.h"
#include "scene/3d/mesh_instance_3d.h"
#include "scene/3d/navigation_region_3d.h"
#include "scene/3d/physics_body_3d.h"
#include "scene/3d/physics/physics_body_3d.h"
#include "scene/3d/physics/static_body_3d.h"
#include "scene/gui/menu_button.h"
#include "scene/main/window.h"
#include "scene/resources/packed_scene.h"
Expand Down
2 changes: 1 addition & 1 deletion editor/plugins/navigation_obstacle_3d_editor_plugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
#define NAVIGATION_OBSTACLE_3D_EDITOR_PLUGIN_H

#include "editor/editor_plugin.h"
#include "scene/3d/collision_polygon_3d.h"
#include "scene/3d/mesh_instance_3d.h"
#include "scene/3d/physics/collision_polygon_3d.h"
#include "scene/gui/box_container.h"
#include "scene/resources/immediate_mesh.h"

Expand Down
4 changes: 2 additions & 2 deletions editor/plugins/node_3d_editor_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,11 @@
#include "editor/plugins/node_3d_editor_gizmos.h"
#include "editor/scene_tree_dock.h"
#include "scene/3d/camera_3d.h"
#include "scene/3d/collision_shape_3d.h"
#include "scene/3d/decal.h"
#include "scene/3d/light_3d.h"
#include "scene/3d/mesh_instance_3d.h"
#include "scene/3d/physics_body_3d.h"
#include "scene/3d/physics/collision_shape_3d.h"
#include "scene/3d/physics/physics_body_3d.h"
#include "scene/3d/visual_instance_3d.h"
#include "scene/3d/world_environment.h"
#include "scene/gui/center_container.h"
Expand Down
1 change: 1 addition & 0 deletions editor/plugins/physical_bone_3d_editor_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
#include "editor/editor_node.h"
#include "editor/editor_string_names.h"
#include "editor/plugins/node_3d_editor_plugin.h"
#include "scene/3d/physics/physical_bone_3d.h"
#include "scene/gui/separator.h"

void PhysicalBone3DEditor::_bind_methods() {
Expand Down
3 changes: 2 additions & 1 deletion editor/plugins/physical_bone_3d_editor_plugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,11 @@
#define PHYSICAL_BONE_3D_EDITOR_PLUGIN_H

#include "editor/editor_plugin.h"
#include "scene/3d/physics_body_3d.h"
#include "scene/gui/box_container.h"
#include "scene/gui/button.h"

class PhysicalBone3D;

class PhysicalBone3DEditor : public Object {
GDCLASS(PhysicalBone3DEditor, Object);

Expand Down
2 changes: 1 addition & 1 deletion editor/plugins/polygon_3d_editor_plugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
#define POLYGON_3D_EDITOR_PLUGIN_H

#include "editor/editor_plugin.h"
#include "scene/3d/collision_polygon_3d.h"
#include "scene/3d/mesh_instance_3d.h"
#include "scene/3d/physics/collision_polygon_3d.h"
#include "scene/gui/box_container.h"
#include "scene/resources/immediate_mesh.h"

Expand Down
7 changes: 4 additions & 3 deletions editor/plugins/skeleton_3d_editor_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,11 @@
#include "editor/plugins/animation_player_editor_plugin.h"
#include "editor/plugins/node_3d_editor_plugin.h"
#include "editor/themes/editor_scale.h"
#include "scene/3d/collision_shape_3d.h"
#include "scene/3d/joint_3d.h"
#include "scene/3d/mesh_instance_3d.h"
#include "scene/3d/physics_body_3d.h"
#include "scene/3d/physics/collision_shape_3d.h"
#include "scene/3d/physics/joints/joint_3d.h"
#include "scene/3d/physics/physical_bone_3d.h"
#include "scene/3d/physics/physics_body_3d.h"
#include "scene/gui/separator.h"
#include "scene/gui/texture_rect.h"
#include "scene/resources/3d/capsule_shape_3d.h"
Expand Down
2 changes: 1 addition & 1 deletion editor/plugins/sprite_2d_editor_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@
#include "editor/gui/editor_zoom_widget.h"
#include "editor/scene_tree_dock.h"
#include "editor/themes/editor_scale.h"
#include "scene/2d/collision_polygon_2d.h"
#include "scene/2d/light_occluder_2d.h"
#include "scene/2d/mesh_instance_2d.h"
#include "scene/2d/physics/collision_polygon_2d.h"
#include "scene/2d/polygon_2d.h"
#include "scene/gui/box_container.h"
#include "scene/gui/menu_button.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@

#include "gltf_document_extension_physics.h"

#include "scene/3d/area_3d.h"
#include "scene/3d/physics/area_3d.h"
#include "scene/3d/physics/static_body_3d.h"

// Import process.
Error GLTFDocumentExtensionPhysics::import_preflight(Ref<GLTFState> p_state, Vector<String> p_extensions) {
Expand Down
7 changes: 5 additions & 2 deletions modules/gltf/extensions/physics/gltf_physics_body.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,11 @@

#include "gltf_physics_body.h"

#include "scene/3d/area_3d.h"
#include "scene/3d/vehicle_body_3d.h"
#include "scene/3d/physics/animatable_body_3d.h"
#include "scene/3d/physics/area_3d.h"
#include "scene/3d/physics/character_body_3d.h"
#include "scene/3d/physics/static_body_3d.h"
#include "scene/3d/physics/vehicle_body_3d.h"

void GLTFPhysicsBody::_bind_methods() {
ClassDB::bind_static_method("GLTFPhysicsBody", D_METHOD("from_node", "body_node"), &GLTFPhysicsBody::from_node);
Expand Down
2 changes: 1 addition & 1 deletion modules/gltf/extensions/physics/gltf_physics_body.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
#ifndef GLTF_PHYSICS_BODY_H
#define GLTF_PHYSICS_BODY_H

#include "scene/3d/physics_body_3d.h"
#include "scene/3d/physics/physics_body_3d.h"

// GLTFPhysicsBody is an intermediary between Godot's physics body nodes
// and the OMI_physics_body extension.
Expand Down
2 changes: 1 addition & 1 deletion modules/gltf/extensions/physics/gltf_physics_shape.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
#include "../../gltf_state.h"

#include "core/math/convex_hull.h"
#include "scene/3d/area_3d.h"
#include "scene/3d/physics/area_3d.h"
#include "scene/resources/3d/box_shape_3d.h"
#include "scene/resources/3d/capsule_shape_3d.h"
#include "scene/resources/3d/concave_polygon_shape_3d.h"
Expand Down
2 changes: 1 addition & 1 deletion modules/gltf/extensions/physics/gltf_physics_shape.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

#include "../../gltf_defines.h"

#include "scene/3d/collision_shape_3d.h"
#include "scene/3d/physics/collision_shape_3d.h"

class ImporterMesh;

Expand Down
2 changes: 1 addition & 1 deletion modules/navigation/2d/nav_mesh_generator_2d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
#include "core/config/project_settings.h"
#include "scene/2d/mesh_instance_2d.h"
#include "scene/2d/multimesh_instance_2d.h"
#include "scene/2d/physics_body_2d.h"
#include "scene/2d/physics/static_body_2d.h"
#include "scene/2d/polygon_2d.h"
#include "scene/2d/tile_map.h"
#include "scene/resources/2d/capsule_shape_2d.h"
Expand Down
2 changes: 1 addition & 1 deletion modules/navigation/3d/nav_mesh_generator_3d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
#include "core/os/thread.h"
#include "scene/3d/mesh_instance_3d.h"
#include "scene/3d/multimesh_instance_3d.h"
#include "scene/3d/physics_body_3d.h"
#include "scene/3d/physics/static_body_3d.h"
#include "scene/resources/3d/box_shape_3d.h"
#include "scene/resources/3d/capsule_shape_3d.h"
#include "scene/resources/3d/concave_polygon_shape_3d.h"
Expand Down
3 changes: 3 additions & 0 deletions scene/2d/SCsub
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@
Import("env")

env.add_source_files(env.scene_sources, "*.cpp")

# Chain load SCsubs
SConscript("physics/SCsub")
2 changes: 1 addition & 1 deletion scene/2d/audio_stream_player_2d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
#include "audio_stream_player_2d.compat.inc"

#include "core/config/project_settings.h"
#include "scene/2d/area_2d.h"
#include "scene/2d/audio_listener_2d.h"
#include "scene/2d/physics/area_2d.h"
#include "scene/audio/audio_stream_player_internal.h"
#include "scene/main/viewport.h"
#include "scene/resources/world_2d.h"
Expand Down
Loading

0 comments on commit 21e3b21

Please sign in to comment.