Move NavigationMeshEditorPlugin to Recast module as should be
Modules can register their own editor plugins (like GridMap does), so no need to put module-specific classes in the `editor/` folder. Also cleans up the previous SCons env pollution from the Recast module, integrating its code into libmodules as other modules.
This commit is contained in:
parent
65fc525ed8
commit
59c2c21b15
7 changed files with 14 additions and 30 deletions
|
@ -88,7 +88,6 @@
|
||||||
#include "editor/plugins/mesh_editor_plugin.h"
|
#include "editor/plugins/mesh_editor_plugin.h"
|
||||||
#include "editor/plugins/mesh_instance_editor_plugin.h"
|
#include "editor/plugins/mesh_instance_editor_plugin.h"
|
||||||
#include "editor/plugins/multimesh_editor_plugin.h"
|
#include "editor/plugins/multimesh_editor_plugin.h"
|
||||||
#include "editor/plugins/navigation_mesh_editor_plugin.h"
|
|
||||||
#include "editor/plugins/navigation_polygon_editor_plugin.h"
|
#include "editor/plugins/navigation_polygon_editor_plugin.h"
|
||||||
#include "editor/plugins/particles_2d_editor_plugin.h"
|
#include "editor/plugins/particles_2d_editor_plugin.h"
|
||||||
#include "editor/plugins/particles_editor_plugin.h"
|
#include "editor/plugins/particles_editor_plugin.h"
|
||||||
|
@ -5365,7 +5364,6 @@ EditorNode::EditorNode() {
|
||||||
add_editor_plugin(memnew(TextureEditorPlugin(this)));
|
add_editor_plugin(memnew(TextureEditorPlugin(this)));
|
||||||
add_editor_plugin(memnew(AudioBusesEditorPlugin(audio_bus_editor)));
|
add_editor_plugin(memnew(AudioBusesEditorPlugin(audio_bus_editor)));
|
||||||
add_editor_plugin(memnew(AudioBusesEditorPlugin(audio_bus_editor)));
|
add_editor_plugin(memnew(AudioBusesEditorPlugin(audio_bus_editor)));
|
||||||
add_editor_plugin(memnew(NavigationMeshEditorPlugin(this)));
|
|
||||||
add_editor_plugin(memnew(SkeletonEditorPlugin(this)));
|
add_editor_plugin(memnew(SkeletonEditorPlugin(this)));
|
||||||
add_editor_plugin(memnew(PhysicalBonePlugin(this)));
|
add_editor_plugin(memnew(PhysicalBonePlugin(this)));
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,9 @@
|
||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
|
|
||||||
Import('env')
|
Import('env')
|
||||||
|
Import('env_modules')
|
||||||
|
|
||||||
# Not building in a separate env as core needs it
|
env_recast = env_modules.Clone()
|
||||||
|
|
||||||
# Thirdparty source files
|
# Thirdparty source files
|
||||||
if env['builtin_recast']:
|
if env['builtin_recast']:
|
||||||
|
@ -22,13 +23,10 @@ if env['builtin_recast']:
|
||||||
]
|
]
|
||||||
thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources]
|
thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources]
|
||||||
|
|
||||||
env.Append(CPPPATH=[thirdparty_dir, thirdparty_dir + "/Include"])
|
env_recast.add_source_files(env.modules_sources, thirdparty_sources)
|
||||||
|
env_recast.Append(CPPPATH=[thirdparty_dir + "/Include"])
|
||||||
lib = env.add_library("recast_builtin", thirdparty_sources)
|
|
||||||
env.Append(LIBS=[lib])
|
|
||||||
|
|
||||||
# Godot source files
|
# Godot source files
|
||||||
env.add_source_files(env.modules_sources, "*.cpp")
|
env_recast.add_source_files(env.modules_sources, "*.cpp")
|
||||||
env.Append(CCFLAGS=['-DRECAST_ENABLED'])
|
|
||||||
|
|
||||||
Export('env')
|
Export('env')
|
||||||
|
|
|
@ -29,13 +29,12 @@
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
|
|
||||||
#include "navigation_mesh_editor_plugin.h"
|
#include "navigation_mesh_editor_plugin.h"
|
||||||
|
|
||||||
#include "io/marshalls.h"
|
#include "io/marshalls.h"
|
||||||
#include "io/resource_saver.h"
|
#include "io/resource_saver.h"
|
||||||
#include "scene/3d/mesh_instance.h"
|
#include "scene/3d/mesh_instance.h"
|
||||||
#include "scene/gui/box_container.h"
|
#include "scene/gui/box_container.h"
|
||||||
|
|
||||||
#ifdef RECAST_ENABLED
|
|
||||||
|
|
||||||
void NavigationMeshEditor::_node_removed(Node *p_node) {
|
void NavigationMeshEditor::_node_removed(Node *p_node) {
|
||||||
|
|
||||||
if (p_node == node) {
|
if (p_node == node) {
|
||||||
|
@ -162,5 +161,3 @@ NavigationMeshEditorPlugin::NavigationMeshEditorPlugin(EditorNode *p_node) {
|
||||||
|
|
||||||
NavigationMeshEditorPlugin::~NavigationMeshEditorPlugin() {
|
NavigationMeshEditorPlugin::~NavigationMeshEditorPlugin() {
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // RECAST_ENABLED
|
|
|
@ -31,8 +31,6 @@
|
||||||
#ifndef NAVIGATION_MESH_GENERATOR_PLUGIN_H
|
#ifndef NAVIGATION_MESH_GENERATOR_PLUGIN_H
|
||||||
#define NAVIGATION_MESH_GENERATOR_PLUGIN_H
|
#define NAVIGATION_MESH_GENERATOR_PLUGIN_H
|
||||||
|
|
||||||
#ifdef RECAST_ENABLED
|
|
||||||
|
|
||||||
#include "editor/editor_node.h"
|
#include "editor/editor_node.h"
|
||||||
#include "editor/editor_plugin.h"
|
#include "editor/editor_plugin.h"
|
||||||
#include "navigation_mesh_generator.h"
|
#include "navigation_mesh_generator.h"
|
||||||
|
@ -83,5 +81,4 @@ public:
|
||||||
~NavigationMeshEditorPlugin();
|
~NavigationMeshEditorPlugin();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // RECAST_ENABLED
|
|
||||||
#endif // NAVIGATION_MESH_GENERATOR_PLUGIN_H
|
#endif // NAVIGATION_MESH_GENERATOR_PLUGIN_H
|
|
@ -30,8 +30,6 @@
|
||||||
|
|
||||||
#include "navigation_mesh_generator.h"
|
#include "navigation_mesh_generator.h"
|
||||||
|
|
||||||
#ifdef RECAST_ENABLED
|
|
||||||
|
|
||||||
void NavigationMeshGenerator::_add_vertex(const Vector3 &p_vec3, Vector<float> &p_verticies) {
|
void NavigationMeshGenerator::_add_vertex(const Vector3 &p_vec3, Vector<float> &p_verticies) {
|
||||||
p_verticies.push_back(p_vec3.x);
|
p_verticies.push_back(p_vec3.x);
|
||||||
p_verticies.push_back(p_vec3.y);
|
p_verticies.push_back(p_vec3.y);
|
||||||
|
@ -304,5 +302,3 @@ void NavigationMeshGenerator::clear(Ref<NavigationMesh> p_nav_mesh) {
|
||||||
p_nav_mesh->set_vertices(PoolVector<Vector3>());
|
p_nav_mesh->set_vertices(PoolVector<Vector3>());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif //RECAST_ENABLED
|
|
|
@ -31,16 +31,11 @@
|
||||||
#ifndef NAVIGATION_MESH_GENERATOR_H
|
#ifndef NAVIGATION_MESH_GENERATOR_H
|
||||||
#define NAVIGATION_MESH_GENERATOR_H
|
#define NAVIGATION_MESH_GENERATOR_H
|
||||||
|
|
||||||
#ifdef RECAST_ENABLED
|
|
||||||
|
|
||||||
#include "editor/editor_node.h"
|
#include "editor/editor_node.h"
|
||||||
#include "editor/editor_settings.h"
|
#include "editor/editor_settings.h"
|
||||||
|
|
||||||
#include "scene/3d/mesh_instance.h"
|
|
||||||
|
|
||||||
#include "scene/3d/navigation_mesh.h"
|
|
||||||
|
|
||||||
#include "os/thread.h"
|
#include "os/thread.h"
|
||||||
|
#include "scene/3d/mesh_instance.h"
|
||||||
|
#include "scene/3d/navigation_mesh.h"
|
||||||
#include "scene/resources/shape.h"
|
#include "scene/resources/shape.h"
|
||||||
|
|
||||||
#include <Recast.h>
|
#include <Recast.h>
|
||||||
|
@ -61,6 +56,4 @@ public:
|
||||||
static void clear(Ref<NavigationMesh> p_nav_mesh);
|
static void clear(Ref<NavigationMesh> p_nav_mesh);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // RECAST_ENABLED
|
|
||||||
|
|
||||||
#endif // NAVIGATION_MESH_GENERATOR_H
|
#endif // NAVIGATION_MESH_GENERATOR_H
|
|
@ -30,5 +30,10 @@
|
||||||
|
|
||||||
#include "register_types.h"
|
#include "register_types.h"
|
||||||
|
|
||||||
void register_recast_types() {}
|
#include "navigation_mesh_editor_plugin.h"
|
||||||
|
|
||||||
|
void register_recast_types() {
|
||||||
|
EditorPlugins::add_by_type<NavigationMeshEditorPlugin>();
|
||||||
|
}
|
||||||
|
|
||||||
void unregister_recast_types() {}
|
void unregister_recast_types() {}
|
||||||
|
|
Loading…
Reference in a new issue