Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
godot
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
community
godot
Commits
bc9e9f1d
Unverified
Commit
bc9e9f1d
authored
Mar 09, 2020
by
Rémi Verschelde
Committed by
GitHub
Mar 09, 2020
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #36911 from lupoDharkael/nav-rename
Complete NavigationMeshInstance rename
parents
e162c07a
d63bf6de
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
11 deletions
+11
-11
navigation_mesh_editor_plugin.cpp
modules/gdnavigation/navigation_mesh_editor_plugin.cpp
+3
-3
navigation_mesh_editor_plugin.h
modules/gdnavigation/navigation_mesh_editor_plugin.h
+1
-1
navigation_region.cpp
scene/3d/navigation_region.cpp
+7
-7
No files found.
modules/gdnavigation/navigation_mesh_editor_plugin.cpp
View file @
bc9e9f1d
...
...
@@ -84,13 +84,13 @@ void NavigationMeshEditor::_clear_pressed() {
}
}
void
NavigationMeshEditor
::
edit
(
NavigationRegion
*
p_nav_
mesh_instance
)
{
void
NavigationMeshEditor
::
edit
(
NavigationRegion
*
p_nav_
region
)
{
if
(
p_nav_
mesh_instance
==
NULL
||
node
==
p_nav_mesh_instance
)
{
if
(
p_nav_
region
==
NULL
||
node
==
p_nav_region
)
{
return
;
}
node
=
p_nav_
mesh_instance
;
node
=
p_nav_
region
;
}
void
NavigationMeshEditor
::
_bind_methods
()
{
...
...
modules/gdnavigation/navigation_mesh_editor_plugin.h
View file @
bc9e9f1d
...
...
@@ -61,7 +61,7 @@ protected:
void
_notification
(
int
p_option
);
public
:
void
edit
(
NavigationRegion
*
p_nav_
mesh_instance
);
void
edit
(
NavigationRegion
*
p_nav_
region
);
NavigationMeshEditor
();
~
NavigationMeshEditor
();
};
...
...
scene/3d/navigation_region.cpp
View file @
bc9e9f1d
...
...
@@ -162,22 +162,22 @@ Ref<NavigationMesh> NavigationRegion::get_navigation_mesh() const {
}
struct
BakeThreadsArgs
{
NavigationRegion
*
nav_
mesh_instance
;
NavigationRegion
*
nav_
region
;
};
void
_bake_navigation_mesh
(
void
*
p_user_data
)
{
BakeThreadsArgs
*
args
=
static_cast
<
BakeThreadsArgs
*>
(
p_user_data
);
if
(
args
->
nav_
mesh_instance
->
get_navigation_mesh
().
is_valid
())
{
Ref
<
NavigationMesh
>
nav_mesh
=
args
->
nav_
mesh_instance
->
get_navigation_mesh
()
->
duplicate
();
if
(
args
->
nav_
region
->
get_navigation_mesh
().
is_valid
())
{
Ref
<
NavigationMesh
>
nav_mesh
=
args
->
nav_
region
->
get_navigation_mesh
()
->
duplicate
();
NavigationServer
::
get_singleton
()
->
region_bake_navmesh
(
nav_mesh
,
args
->
nav_
mesh_instance
);
args
->
nav_
mesh_instance
->
call_deferred
(
"_bake_finished"
,
nav_mesh
);
NavigationServer
::
get_singleton
()
->
region_bake_navmesh
(
nav_mesh
,
args
->
nav_
region
);
args
->
nav_
region
->
call_deferred
(
"_bake_finished"
,
nav_mesh
);
memdelete
(
args
);
}
else
{
ERR_PRINT
(
"Can't bake the navigation mesh if the `NavigationMesh` resource doesn't exist"
);
args
->
nav_
mesh_instance
->
call_deferred
(
"_bake_finished"
,
Ref
<
NavigationMesh
>
());
args
->
nav_
region
->
call_deferred
(
"_bake_finished"
,
Ref
<
NavigationMesh
>
());
memdelete
(
args
);
}
}
...
...
@@ -186,7 +186,7 @@ void NavigationRegion::bake_navigation_mesh() {
ERR_FAIL_COND
(
bake_thread
!=
NULL
);
BakeThreadsArgs
*
args
=
memnew
(
BakeThreadsArgs
);
args
->
nav_
mesh_instance
=
this
;
args
->
nav_
region
=
this
;
bake_thread
=
Thread
::
create
(
_bake_navigation_mesh
,
args
);
ERR_FAIL_COND
(
bake_thread
==
NULL
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment