Merge pull request #14676 from NathanWarden/nav_create_to_add
Renamed navmesh_create to navmesh_add since no navmesh is created.
This commit is contained in:
commit
dcdf9008ae
10 changed files with 17 additions and 17 deletions
|
@ -64,7 +64,7 @@
|
|||
Returns a path of points as a [code]PoolVector3Array[/code]. If [code]optimize[/code] is false the [code]NavigationMesh[/code] agent properties will be taken into account, otherwise it will return the nearest path and ignore agent radius, height, etc.
|
||||
</description>
|
||||
</method>
|
||||
<method name="navmesh_create">
|
||||
<method name="navmesh_add">
|
||||
<return type="int">
|
||||
</return>
|
||||
<argument index="0" name="mesh" type="NavigationMesh">
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="navpoly_create">
|
||||
<method name="navpoly_add">
|
||||
<return type="int">
|
||||
</return>
|
||||
<argument index="0" name="mesh" type="NavigationPolygon">
|
||||
|
|
|
@ -469,7 +469,7 @@ bool GridMap::_octant_update(const OctantKey &p_key) {
|
|||
nm.xform = xform;
|
||||
|
||||
if (navigation) {
|
||||
nm.id = navigation->navmesh_create(navmesh, xform, this);
|
||||
nm.id = navigation->navmesh_add(navmesh, xform, this);
|
||||
} else {
|
||||
nm.id = -1;
|
||||
}
|
||||
|
@ -556,7 +556,7 @@ void GridMap::_octant_enter_world(const OctantKey &p_key) {
|
|||
if (cell_map.has(F->key()) && F->get().id < 0) {
|
||||
Ref<NavigationMesh> nm = theme->get_item_navmesh(cell_map[F->key()].item);
|
||||
if (nm.is_valid()) {
|
||||
F->get().id = navigation->navmesh_create(nm, F->get().xform, this);
|
||||
F->get().id = navigation->navmesh_add(nm, F->get().xform, this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -205,7 +205,7 @@ void Navigation2D::_navpoly_unlink(int p_id) {
|
|||
nm.linked = false;
|
||||
}
|
||||
|
||||
int Navigation2D::navpoly_create(const Ref<NavigationPolygon> &p_mesh, const Transform2D &p_xform, Object *p_owner) {
|
||||
int Navigation2D::navpoly_add(const Ref<NavigationPolygon> &p_mesh, const Transform2D &p_xform, Object *p_owner) {
|
||||
|
||||
int id = last_id++;
|
||||
NavMesh nm;
|
||||
|
@ -708,7 +708,7 @@ Object *Navigation2D::get_closest_point_owner(const Vector2 &p_point) {
|
|||
|
||||
void Navigation2D::_bind_methods() {
|
||||
|
||||
ClassDB::bind_method(D_METHOD("navpoly_create", "mesh", "xform", "owner"), &Navigation2D::navpoly_create, DEFVAL(Variant()));
|
||||
ClassDB::bind_method(D_METHOD("navpoly_add", "mesh", "xform", "owner"), &Navigation2D::navpoly_add, DEFVAL(Variant()));
|
||||
ClassDB::bind_method(D_METHOD("navpoly_set_transform", "id", "xform"), &Navigation2D::navpoly_set_transform);
|
||||
ClassDB::bind_method(D_METHOD("navpoly_remove", "id"), &Navigation2D::navpoly_remove);
|
||||
|
||||
|
|
|
@ -159,7 +159,7 @@ protected:
|
|||
|
||||
public:
|
||||
//API should be as dynamic as possible
|
||||
int navpoly_create(const Ref<NavigationPolygon> &p_mesh, const Transform2D &p_xform, Object *p_owner = NULL);
|
||||
int navpoly_add(const Ref<NavigationPolygon> &p_mesh, const Transform2D &p_xform, Object *p_owner = NULL);
|
||||
void navpoly_set_transform(int p_id, const Transform2D &p_xform);
|
||||
void navpoly_remove(int p_id);
|
||||
|
||||
|
|
|
@ -293,7 +293,7 @@ void NavigationPolygonInstance::set_enabled(bool p_enabled) {
|
|||
|
||||
if (navpoly.is_valid()) {
|
||||
|
||||
nav_id = navigation->navpoly_create(navpoly, get_relative_transform_to_parent(navigation), this);
|
||||
nav_id = navigation->navpoly_add(navpoly, get_relative_transform_to_parent(navigation), this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -324,7 +324,7 @@ void NavigationPolygonInstance::_notification(int p_what) {
|
|||
|
||||
if (enabled && navpoly.is_valid()) {
|
||||
|
||||
nav_id = navigation->navpoly_create(navpoly, get_relative_transform_to_parent(navigation), this);
|
||||
nav_id = navigation->navpoly_add(navpoly, get_relative_transform_to_parent(navigation), this);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -419,7 +419,7 @@ void NavigationPolygonInstance::set_navigation_polygon(const Ref<NavigationPolyg
|
|||
}
|
||||
|
||||
if (navigation && navpoly.is_valid() && enabled) {
|
||||
nav_id = navigation->navpoly_create(navpoly, get_relative_transform_to_parent(navigation), this);
|
||||
nav_id = navigation->navpoly_add(navpoly, get_relative_transform_to_parent(navigation), this);
|
||||
}
|
||||
//update_gizmo();
|
||||
_change_notify("navpoly");
|
||||
|
|
|
@ -486,7 +486,7 @@ void TileMap::_update_dirty_quadrants() {
|
|||
xform.set_origin(offset.floor() + q.pos);
|
||||
_fix_cell_transform(xform, c, npoly_ofs + center_ofs, s);
|
||||
|
||||
int pid = navigation->navpoly_create(navpoly, nav_rel * xform);
|
||||
int pid = navigation->navpoly_add(navpoly, nav_rel * xform);
|
||||
|
||||
Quadrant::NavPoly np;
|
||||
np.id = pid;
|
||||
|
|
|
@ -202,7 +202,7 @@ void Navigation::_navmesh_unlink(int p_id) {
|
|||
nm.linked = false;
|
||||
}
|
||||
|
||||
int Navigation::navmesh_create(const Ref<NavigationMesh> &p_mesh, const Transform &p_xform, Object *p_owner) {
|
||||
int Navigation::navmesh_add(const Ref<NavigationMesh> &p_mesh, const Transform &p_xform, Object *p_owner) {
|
||||
|
||||
int id = last_id++;
|
||||
NavMesh nm;
|
||||
|
@ -686,7 +686,7 @@ Vector3 Navigation::get_up_vector() const {
|
|||
|
||||
void Navigation::_bind_methods() {
|
||||
|
||||
ClassDB::bind_method(D_METHOD("navmesh_create", "mesh", "xform", "owner"), &Navigation::navmesh_create, DEFVAL(Variant()));
|
||||
ClassDB::bind_method(D_METHOD("navmesh_add", "mesh", "xform", "owner"), &Navigation::navmesh_add, DEFVAL(Variant()));
|
||||
ClassDB::bind_method(D_METHOD("navmesh_set_transform", "id", "xform"), &Navigation::navmesh_set_transform);
|
||||
ClassDB::bind_method(D_METHOD("navmesh_remove", "id"), &Navigation::navmesh_remove);
|
||||
|
||||
|
|
|
@ -166,7 +166,7 @@ public:
|
|||
Vector3 get_up_vector() const;
|
||||
|
||||
//API should be as dynamic as possible
|
||||
int navmesh_create(const Ref<NavigationMesh> &p_mesh, const Transform &p_xform, Object *p_owner = NULL);
|
||||
int navmesh_add(const Ref<NavigationMesh> &p_mesh, const Transform &p_xform, Object *p_owner = NULL);
|
||||
void navmesh_set_transform(int p_id, const Transform &p_xform);
|
||||
void navmesh_remove(int p_id);
|
||||
|
||||
|
|
|
@ -471,7 +471,7 @@ void NavigationMeshInstance::set_enabled(bool p_enabled) {
|
|||
|
||||
if (navmesh.is_valid()) {
|
||||
|
||||
nav_id = navigation->navmesh_create(navmesh, get_relative_transform(navigation), this);
|
||||
nav_id = navigation->navmesh_add(navmesh, get_relative_transform(navigation), this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -508,7 +508,7 @@ void NavigationMeshInstance::_notification(int p_what) {
|
|||
|
||||
if (enabled && navmesh.is_valid()) {
|
||||
|
||||
nav_id = navigation->navmesh_create(navmesh, get_relative_transform(navigation), this);
|
||||
nav_id = navigation->navmesh_add(navmesh, get_relative_transform(navigation), this);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -568,7 +568,7 @@ void NavigationMeshInstance::set_navigation_mesh(const Ref<NavigationMesh> &p_na
|
|||
navmesh = p_navmesh;
|
||||
|
||||
if (navigation && navmesh.is_valid() && enabled) {
|
||||
nav_id = navigation->navmesh_create(navmesh, get_relative_transform(navigation), this);
|
||||
nav_id = navigation->navmesh_add(navmesh, get_relative_transform(navigation), this);
|
||||
}
|
||||
|
||||
if (debug_view && navmesh.is_valid()) {
|
||||
|
|
Loading…
Reference in a new issue