From 3205a92ad872f918c8322cdcd1434c231a1fd251 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Mon, 17 Feb 2020 18:06:54 -0300 Subject: PoolVector is gone, replaced by Vector Typed `PoolTypeArray` types are now renamed `PackedTypeArray` and are sugar for `Vector`. --- modules/gdnavigation/nav_region.cpp | 4 ++-- modules/gdnavigation/navigation_mesh_generator.cpp | 18 +++++++++--------- modules/gdnavigation/navigation_mesh_generator.h | 2 +- 3 files changed, 12 insertions(+), 12 deletions(-) (limited to 'modules/gdnavigation') diff --git a/modules/gdnavigation/nav_region.cpp b/modules/gdnavigation/nav_region.cpp index d2d9d8b517..0215821305 100644 --- a/modules/gdnavigation/nav_region.cpp +++ b/modules/gdnavigation/nav_region.cpp @@ -78,12 +78,12 @@ void NavRegion::update_polygons() { if (mesh.is_null()) return; - PoolVector vertices = mesh->get_vertices(); + Vector vertices = mesh->get_vertices(); int len = vertices.size(); if (len == 0) return; - PoolVector::Read vertices_r = vertices.read(); + const Vector3 *vertices_r = vertices.ptr(); polygons.resize(mesh->get_polygon_count()); diff --git a/modules/gdnavigation/navigation_mesh_generator.cpp b/modules/gdnavigation/navigation_mesh_generator.cpp index 04b86fabc5..7f8761dac8 100644 --- a/modules/gdnavigation/navigation_mesh_generator.cpp +++ b/modules/gdnavigation/navigation_mesh_generator.cpp @@ -90,13 +90,13 @@ void NavigationMeshGenerator::_add_mesh(const Ref &p_mesh, const Transform Array a = p_mesh->surface_get_arrays(i); - PoolVector mesh_vertices = a[Mesh::ARRAY_VERTEX]; - PoolVector::Read vr = mesh_vertices.read(); + Vector mesh_vertices = a[Mesh::ARRAY_VERTEX]; + const Vector3 *vr = mesh_vertices.ptr(); if (p_mesh->surface_get_format(i) & Mesh::ARRAY_FORMAT_INDEX) { - PoolVector mesh_indices = a[Mesh::ARRAY_INDEX]; - PoolVector::Read ir = mesh_indices.read(); + Vector mesh_indices = a[Mesh::ARRAY_INDEX]; + const int *ir = mesh_indices.ptr(); for (int j = 0; j < mesh_vertices.size(); j++) { _add_vertex(p_xform.xform(vr[j]), p_verticies); @@ -123,7 +123,7 @@ void NavigationMeshGenerator::_add_mesh(const Ref &p_mesh, const Transform } } -void NavigationMeshGenerator::_add_faces(const PoolVector3Array &p_faces, const Transform &p_xform, Vector &p_verticies, Vector &p_indices) { +void NavigationMeshGenerator::_add_faces(const PackedVector3Array &p_faces, const Transform &p_xform, Vector &p_verticies, Vector &p_indices) { int face_count = p_faces.size() / 3; int current_vertex_count = p_verticies.size() / 3; @@ -227,7 +227,7 @@ void NavigationMeshGenerator::_parse_geometry(Transform p_accumulated_transform, Error err = QuickHull::build(varr, md); if (err == OK) { - PoolVector3Array faces; + PackedVector3Array faces; for (int j = 0; j < md.faces.size(); ++j) { Geometry::MeshData::Face face = md.faces[j]; @@ -279,11 +279,11 @@ void NavigationMeshGenerator::_parse_geometry(Transform p_accumulated_transform, void NavigationMeshGenerator::_convert_detail_mesh_to_native_navigation_mesh(const rcPolyMeshDetail *p_detail_mesh, Ref p_nav_mesh) { - PoolVector nav_vertices; + Vector nav_vertices; for (int i = 0; i < p_detail_mesh->nverts; i++) { const float *v = &p_detail_mesh->verts[i * 3]; - nav_vertices.append(Vector3(v[0], v[1], v[2])); + nav_vertices.push_back(Vector3(v[0], v[1], v[2])); } p_nav_mesh->set_vertices(nav_vertices); @@ -562,7 +562,7 @@ void NavigationMeshGenerator::bake(Ref p_nav_mesh, Node *p_node) void NavigationMeshGenerator::clear(Ref p_nav_mesh) { if (p_nav_mesh.is_valid()) { p_nav_mesh->clear_polygons(); - p_nav_mesh->set_vertices(PoolVector()); + p_nav_mesh->set_vertices(Vector()); } } diff --git a/modules/gdnavigation/navigation_mesh_generator.h b/modules/gdnavigation/navigation_mesh_generator.h index 107dee75e2..27a56e1d7a 100644 --- a/modules/gdnavigation/navigation_mesh_generator.h +++ b/modules/gdnavigation/navigation_mesh_generator.h @@ -51,7 +51,7 @@ protected: static void _add_vertex(const Vector3 &p_vec3, Vector &p_verticies); static void _add_mesh(const Ref &p_mesh, const Transform &p_xform, Vector &p_verticies, Vector &p_indices); - static void _add_faces(const PoolVector3Array &p_faces, const Transform &p_xform, Vector &p_verticies, Vector &p_indices); + static void _add_faces(const PackedVector3Array &p_faces, const Transform &p_xform, Vector &p_verticies, Vector &p_indices); static void _parse_geometry(Transform p_accumulated_transform, Node *p_node, Vector &p_verticies, Vector &p_indices, int p_generate_from, uint32_t p_collision_mask, bool p_recurse_children); static void _convert_detail_mesh_to_native_navigation_mesh(const rcPolyMeshDetail *p_detail_mesh, Ref p_nav_mesh); -- cgit v1.2.3