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`. --- scene/resources/navigation_mesh.cpp | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'scene/resources/navigation_mesh.cpp') diff --git a/scene/resources/navigation_mesh.cpp b/scene/resources/navigation_mesh.cpp index e6544778bc..809513c5ae 100644 --- a/scene/resources/navigation_mesh.cpp +++ b/scene/resources/navigation_mesh.cpp @@ -32,7 +32,7 @@ void NavigationMesh::create_from_mesh(const Ref &p_mesh) { - vertices = PoolVector(); + vertices = Vector(); clear_polygons(); for (int i = 0; i < p_mesh->get_surface_count(); i++) { @@ -40,15 +40,15 @@ void NavigationMesh::create_from_mesh(const Ref &p_mesh) { if (p_mesh->surface_get_primitive_type(i) != Mesh::PRIMITIVE_TRIANGLES) continue; Array arr = p_mesh->surface_get_arrays(i); - PoolVector varr = arr[Mesh::ARRAY_VERTEX]; - PoolVector iarr = arr[Mesh::ARRAY_INDEX]; + Vector varr = arr[Mesh::ARRAY_VERTEX]; + Vector iarr = arr[Mesh::ARRAY_INDEX]; if (varr.size() == 0 || iarr.size() == 0) continue; int from = vertices.size(); vertices.append_array(varr); int rlen = iarr.size(); - PoolVector::Read r = iarr.read(); + const int *r = iarr.ptr(); for (int j = 0; j < rlen; j += 3) { Vector vi; @@ -252,13 +252,13 @@ bool NavigationMesh::get_filter_walkable_low_height_spans() const { return filter_walkable_low_height_spans; } -void NavigationMesh::set_vertices(const PoolVector &p_vertices) { +void NavigationMesh::set_vertices(const Vector &p_vertices) { vertices = p_vertices; _change_notify(); } -PoolVector NavigationMesh::get_vertices() const { +Vector NavigationMesh::get_vertices() const { return vertices; } @@ -309,8 +309,8 @@ Ref NavigationMesh::get_debug_mesh() { if (debug_mesh.is_valid()) return debug_mesh; - PoolVector vertices = get_vertices(); - PoolVector::Read vr = vertices.read(); + Vector vertices = get_vertices(); + const Vector3 *vr = vertices.ptr(); List faces; for (int i = 0; i < get_polygon_count(); i++) { Vector p = get_polygon(i); @@ -326,11 +326,11 @@ Ref NavigationMesh::get_debug_mesh() { } Map<_EdgeKey, bool> edge_map; - PoolVector tmeshfaces; + Vector tmeshfaces; tmeshfaces.resize(faces.size() * 3); { - PoolVector::Write tw = tmeshfaces.write(); + Vector3 *tw = tmeshfaces.ptrw(); int tidx = 0; for (List::Element *E = faces.front(); E; E = E->next()) { @@ -369,10 +369,10 @@ Ref NavigationMesh::get_debug_mesh() { } } - PoolVector varr; + Vector varr; varr.resize(lines.size()); { - PoolVector::Write w = varr.write(); + Vector3 *w = varr.ptrw(); int idx = 0; for (List::Element *E = lines.front(); E; E = E->next()) { w[idx++] = E->get(); @@ -478,7 +478,7 @@ void NavigationMesh::_bind_methods() { BIND_CONSTANT(PARSED_GEOMETRY_STATIC_COLLIDERS); BIND_CONSTANT(PARSED_GEOMETRY_BOTH); - ADD_PROPERTY(PropertyInfo(Variant::POOL_VECTOR3_ARRAY, "vertices", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_INTERNAL), "set_vertices", "get_vertices"); + ADD_PROPERTY(PropertyInfo(Variant::PACKED_VECTOR3_ARRAY, "vertices", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_INTERNAL), "set_vertices", "get_vertices"); ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "polygons", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_INTERNAL), "_set_polygons", "_get_polygons"); ADD_PROPERTY(PropertyInfo(Variant::INT, "sample_partition_type/sample_partition_type", PROPERTY_HINT_ENUM, "Watershed,Monotone,Layers"), "set_sample_partition_type", "get_sample_partition_type"); -- cgit v1.2.3