summaryrefslogtreecommitdiff
path: root/scene/3d
diff options
context:
space:
mode:
Diffstat (limited to 'scene/3d')
-rw-r--r--scene/3d/navigation.h2
-rw-r--r--scene/3d/navigation_region.cpp (renamed from scene/3d/navigation_mesh_instance.cpp)44
-rw-r--r--scene/3d/navigation_region.h (renamed from scene/3d/navigation_mesh_instance.h)16
3 files changed, 31 insertions, 31 deletions
diff --git a/scene/3d/navigation.h b/scene/3d/navigation.h
index 85887651ff..08f306611f 100644
--- a/scene/3d/navigation.h
+++ b/scene/3d/navigation.h
@@ -31,7 +31,7 @@
#ifndef NAVIGATION_H
#define NAVIGATION_H
-#include "scene/3d/navigation_mesh_instance.h"
+#include "scene/3d/navigation_region.h"
#include "scene/3d/spatial.h"
class Navigation : public Spatial {
diff --git a/scene/3d/navigation_mesh_instance.cpp b/scene/3d/navigation_region.cpp
index 8f8574ba2d..d96d095797 100644
--- a/scene/3d/navigation_mesh_instance.cpp
+++ b/scene/3d/navigation_region.cpp
@@ -1,5 +1,5 @@
/*************************************************************************/
-/* navigation_mesh_instance.cpp */
+/* navigation_region.cpp */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@@ -28,13 +28,13 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
-#include "navigation_mesh_instance.h"
+#include "navigation_region.h"
#include "core/os/thread.h"
#include "mesh_instance.h"
#include "navigation.h"
#include "servers/navigation_server.h"
-void NavigationMeshInstance::set_enabled(bool p_enabled) {
+void NavigationRegion::set_enabled(bool p_enabled) {
if (enabled == p_enabled)
return;
@@ -66,14 +66,14 @@ void NavigationMeshInstance::set_enabled(bool p_enabled) {
update_gizmo();
}
-bool NavigationMeshInstance::is_enabled() const {
+bool NavigationRegion::is_enabled() const {
return enabled;
}
/////////////////////////////
-void NavigationMeshInstance::_notification(int p_what) {
+void NavigationRegion::_notification(int p_what) {
switch (p_what) {
case NOTIFICATION_ENTER_TREE: {
@@ -129,7 +129,7 @@ void NavigationMeshInstance::_notification(int p_what) {
}
}
-void NavigationMeshInstance::set_navigation_mesh(const Ref<NavigationMesh> &p_navmesh) {
+void NavigationRegion::set_navigation_mesh(const Ref<NavigationMesh> &p_navmesh) {
if (p_navmesh == navmesh)
return;
@@ -156,13 +156,13 @@ void NavigationMeshInstance::set_navigation_mesh(const Ref<NavigationMesh> &p_na
update_configuration_warning();
}
-Ref<NavigationMesh> NavigationMeshInstance::get_navigation_mesh() const {
+Ref<NavigationMesh> NavigationRegion::get_navigation_mesh() const {
return navmesh;
}
struct BakeThreadsArgs {
- NavigationMeshInstance *nav_mesh_instance;
+ NavigationRegion *nav_mesh_instance;
};
void _bake_navigation_mesh(void *p_user_data) {
@@ -182,7 +182,7 @@ void _bake_navigation_mesh(void *p_user_data) {
}
}
-void NavigationMeshInstance::bake_navigation_mesh() {
+void NavigationRegion::bake_navigation_mesh() {
ERR_FAIL_COND(bake_thread != NULL);
BakeThreadsArgs *args = memnew(BakeThreadsArgs);
@@ -192,12 +192,12 @@ void NavigationMeshInstance::bake_navigation_mesh() {
ERR_FAIL_COND(bake_thread == NULL);
}
-void NavigationMeshInstance::_bake_finished(Ref<NavigationMesh> p_nav_mesh) {
+void NavigationRegion::_bake_finished(Ref<NavigationMesh> p_nav_mesh) {
set_navigation_mesh(p_nav_mesh);
bake_thread = NULL;
}
-String NavigationMeshInstance::get_configuration_warning() const {
+String NavigationRegion::get_configuration_warning() const {
if (!is_visible_in_tree() || !is_inside_tree())
return String();
@@ -214,19 +214,19 @@ String NavigationMeshInstance::get_configuration_warning() const {
c = Object::cast_to<Spatial>(c->get_parent());
}
- return TTR("NavigationMeshInstance must be a child or grandchild to a Navigation node. It only provides navigation data.");
+ return TTR("NavigationRegion must be a child or grandchild to a Navigation node. It only provides navigation data.");
}
-void NavigationMeshInstance::_bind_methods() {
+void NavigationRegion::_bind_methods() {
- ClassDB::bind_method(D_METHOD("set_navigation_mesh", "navmesh"), &NavigationMeshInstance::set_navigation_mesh);
- ClassDB::bind_method(D_METHOD("get_navigation_mesh"), &NavigationMeshInstance::get_navigation_mesh);
+ ClassDB::bind_method(D_METHOD("set_navigation_mesh", "navmesh"), &NavigationRegion::set_navigation_mesh);
+ ClassDB::bind_method(D_METHOD("get_navigation_mesh"), &NavigationRegion::get_navigation_mesh);
- ClassDB::bind_method(D_METHOD("set_enabled", "enabled"), &NavigationMeshInstance::set_enabled);
- ClassDB::bind_method(D_METHOD("is_enabled"), &NavigationMeshInstance::is_enabled);
+ ClassDB::bind_method(D_METHOD("set_enabled", "enabled"), &NavigationRegion::set_enabled);
+ ClassDB::bind_method(D_METHOD("is_enabled"), &NavigationRegion::is_enabled);
- ClassDB::bind_method(D_METHOD("bake_navigation_mesh"), &NavigationMeshInstance::bake_navigation_mesh);
- ClassDB::bind_method(D_METHOD("_bake_finished", "nav_mesh"), &NavigationMeshInstance::_bake_finished);
+ ClassDB::bind_method(D_METHOD("bake_navigation_mesh"), &NavigationRegion::bake_navigation_mesh);
+ ClassDB::bind_method(D_METHOD("_bake_finished", "nav_mesh"), &NavigationRegion::_bake_finished);
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "navmesh", PROPERTY_HINT_RESOURCE_TYPE, "NavigationMesh"), "set_navigation_mesh", "get_navigation_mesh");
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "enabled"), "set_enabled", "is_enabled");
@@ -235,12 +235,12 @@ void NavigationMeshInstance::_bind_methods() {
ADD_SIGNAL(MethodInfo("bake_finished"));
}
-void NavigationMeshInstance::_changed_callback(Object *p_changed, const char *p_prop) {
+void NavigationRegion::_changed_callback(Object *p_changed, const char *p_prop) {
update_gizmo();
update_configuration_warning();
}
-NavigationMeshInstance::NavigationMeshInstance() {
+NavigationRegion::NavigationRegion() {
enabled = true;
set_notify_transform(true);
@@ -251,7 +251,7 @@ NavigationMeshInstance::NavigationMeshInstance() {
bake_thread = NULL;
}
-NavigationMeshInstance::~NavigationMeshInstance() {
+NavigationRegion::~NavigationRegion() {
if (navmesh.is_valid())
navmesh->remove_change_receptor(this);
NavigationServer::get_singleton()->free(region);
diff --git a/scene/3d/navigation_mesh_instance.h b/scene/3d/navigation_region.h
index 1135bf47d2..c6b2ea350f 100644
--- a/scene/3d/navigation_mesh_instance.h
+++ b/scene/3d/navigation_region.h
@@ -1,5 +1,5 @@
/*************************************************************************/
-/* navigation_mesh_instance.h */
+/* navigation_region.h */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@@ -28,8 +28,8 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
-#ifndef NAVIGATION_MESH_INSTANCE_H
-#define NAVIGATION_MESH_INSTANCE_H
+#ifndef navigation_region_H
+#define navigation_region_H
#include "scene/3d/spatial.h"
#include "scene/resources/mesh.h"
@@ -37,9 +37,9 @@
class Navigation;
-class NavigationMeshInstance : public Spatial {
+class NavigationRegion : public Spatial {
- GDCLASS(NavigationMeshInstance, Spatial);
+ GDCLASS(NavigationRegion, Spatial);
bool enabled;
RID region;
@@ -68,8 +68,8 @@ public:
String get_configuration_warning() const;
- NavigationMeshInstance();
- ~NavigationMeshInstance();
+ NavigationRegion();
+ ~NavigationRegion();
};
-#endif // NAVIGATION_MESH_INSTANCE_H
+#endif // navigation_region_H