17 v.
p.
x = current_vertex.x;
18 v.
p.
y = current_vertex.y;
19 v.
p.
z = current_vertex.z;
20 Simplification.
vertices.push_back(v);
23 for (
size_t i = 0; i < pmesh->GetIndexes().size() - 2; i += 3) {
26 auto indices = pmesh->GetIndexes();
27 t.
v[0] = (indices[i]) - 1;
28 t.
v[1] = (indices[i + 1]) - 1;
29 t.
v[2] = (indices[i + 2]) - 1;
34 float target_size = Simplification.
triangles.size();
37 pmesh->GetVertices().clear();
38 pmesh->GetIndexes().clear();
42 v.
x = current_vertex.
p.
x;
43 v.
y = current_vertex.
p.
y;
44 v.
z = current_vertex.
p.
z;
48 for (
size_t i = 0; i < Simplification.
triangles.size(); ++i) {
49 pmesh->GetIndexes().push_back((Simplification.
triangles[i].v[0]) + 1);
50 pmesh->GetIndexes().push_back((Simplification.
triangles[i].v[1]) + 1);
51 pmesh->GetIndexes().push_back((Simplification.
triangles[i].v[2]) + 1);
This file contains definitions of common data structures used in traffic manager. ...
std::vector< Vertex > vertices
std::vector< Triangle > triangles
float simplification_percentage
void Simplificate(const std::unique_ptr< geom::Mesh > &pmesh)
void simplify_mesh(int target_count, double agressiveness=7, bool verbose=false)