diff options
Diffstat (limited to 'modules')
-rw-r--r-- | modules/gridmap/doc_classes/GridMap.xml | 4 | ||||
-rw-r--r-- | modules/gridmap/grid_map.cpp | 12 | ||||
-rw-r--r-- | modules/gridmap/grid_map.h | 4 | ||||
-rw-r--r-- | modules/navigation/godot_navigation_server.cpp | 12 | ||||
-rw-r--r-- | modules/navigation/godot_navigation_server.h | 6 |
5 files changed, 19 insertions, 19 deletions
diff --git a/modules/gridmap/doc_classes/GridMap.xml b/modules/gridmap/doc_classes/GridMap.xml index 209890a333..6717f23057 100644 --- a/modules/gridmap/doc_classes/GridMap.xml +++ b/modules/gridmap/doc_classes/GridMap.xml @@ -102,13 +102,13 @@ </description> </method> <method name="get_used_cells" qualifiers="const"> - <return type="Array" /> + <return type="Vector3i[]" /> <description> Returns an array of [Vector3] with the non-empty cell coordinates in the grid map. </description> </method> <method name="get_used_cells_by_item" qualifiers="const"> - <return type="Array" /> + <return type="Vector3i[]" /> <param index="0" name="item" type="int" /> <description> Returns an array of all cells with the given item index specified in [code]item[/code]. diff --git a/modules/gridmap/grid_map.cpp b/modules/gridmap/grid_map.cpp index 6384446bce..f207d4a741 100644 --- a/modules/gridmap/grid_map.cpp +++ b/modules/gridmap/grid_map.cpp @@ -1049,23 +1049,23 @@ float GridMap::get_cell_scale() const { return cell_scale; } -Array GridMap::get_used_cells() const { - Array a; +TypedArray<Vector3i> GridMap::get_used_cells() const { + TypedArray<Vector3i> a; a.resize(cell_map.size()); int i = 0; for (const KeyValue<IndexKey, Cell> &E : cell_map) { - Vector3 p(E.key.x, E.key.y, E.key.z); + Vector3i p(E.key.x, E.key.y, E.key.z); a[i++] = p; } return a; } -Array GridMap::get_used_cells_by_item(int p_item) const { - Array a; +TypedArray<Vector3i> GridMap::get_used_cells_by_item(int p_item) const { + TypedArray<Vector3i> a; for (const KeyValue<IndexKey, Cell> &E : cell_map) { if (E.value.item == p_item) { - Vector3 p(E.key.x, E.key.y, E.key.z); + Vector3i p(E.key.x, E.key.y, E.key.z); a.push_back(p); } } diff --git a/modules/gridmap/grid_map.h b/modules/gridmap/grid_map.h index 00cebd35e9..0ed4695fb9 100644 --- a/modules/gridmap/grid_map.h +++ b/modules/gridmap/grid_map.h @@ -273,8 +273,8 @@ public: void set_cell_scale(float p_scale); float get_cell_scale() const; - Array get_used_cells() const; - Array get_used_cells_by_item(int p_item) const; + TypedArray<Vector3i> get_used_cells() const; + TypedArray<Vector3i> get_used_cells_by_item(int p_item) const; Array get_meshes() const; diff --git a/modules/navigation/godot_navigation_server.cpp b/modules/navigation/godot_navigation_server.cpp index 2cdb5b7cb4..6bb522cc01 100644 --- a/modules/navigation/godot_navigation_server.cpp +++ b/modules/navigation/godot_navigation_server.cpp @@ -123,8 +123,8 @@ void GodotNavigationServer::add_command(SetCommand *command) const { } } -Array GodotNavigationServer::get_maps() const { - Array all_map_rids; +TypedArray<RID> GodotNavigationServer::get_maps() const { + TypedArray<RID> all_map_rids; List<RID> maps_owned; map_owner.get_owned_list(&maps_owned); if (maps_owned.size()) { @@ -245,8 +245,8 @@ RID GodotNavigationServer::map_get_closest_point_owner(RID p_map, const Vector3 return map->get_closest_point_owner(p_point); } -Array GodotNavigationServer::map_get_regions(RID p_map) const { - Array regions_rids; +TypedArray<RID> GodotNavigationServer::map_get_regions(RID p_map) const { + TypedArray<RID> regions_rids; const NavMap *map = map_owner.get_or_null(p_map); ERR_FAIL_COND_V(map == nullptr, regions_rids); const LocalVector<NavRegion *> regions = map->get_regions(); @@ -257,8 +257,8 @@ Array GodotNavigationServer::map_get_regions(RID p_map) const { return regions_rids; } -Array GodotNavigationServer::map_get_agents(RID p_map) const { - Array agents_rids; +TypedArray<RID> GodotNavigationServer::map_get_agents(RID p_map) const { + TypedArray<RID> agents_rids; const NavMap *map = map_owner.get_or_null(p_map); ERR_FAIL_COND_V(map == nullptr, agents_rids); const LocalVector<RvoAgent *> agents = map->get_agents(); diff --git a/modules/navigation/godot_navigation_server.h b/modules/navigation/godot_navigation_server.h index da1f8cba0b..e5f4b421bc 100644 --- a/modules/navigation/godot_navigation_server.h +++ b/modules/navigation/godot_navigation_server.h @@ -85,7 +85,7 @@ public: void add_command(SetCommand *command) const; - virtual Array get_maps() const override; + virtual TypedArray<RID> get_maps() const override; virtual RID map_create() const override; COMMAND_2(map_set_active, RID, p_map, bool, p_active); @@ -107,8 +107,8 @@ public: virtual Vector3 map_get_closest_point_normal(RID p_map, const Vector3 &p_point) const override; virtual RID map_get_closest_point_owner(RID p_map, const Vector3 &p_point) const override; - virtual Array map_get_regions(RID p_map) const override; - virtual Array map_get_agents(RID p_map) const override; + virtual TypedArray<RID> map_get_regions(RID p_map) const override; + virtual TypedArray<RID> map_get_agents(RID p_map) const override; virtual void map_force_update(RID p_map) override; |