| 173 | } |
| 174 | |
| 175 | void Model::ComputeVCH(Model &convex) |
| 176 | { |
| 177 | btConvexHullComputer ch; |
| 178 | ch.compute(points, -1.0, -1.0); |
| 179 | for (int32_t v = 0; v < ch.vertices.size(); v++) |
| 180 | { |
| 181 | convex.points.push_back({ch.vertices[v].getX(), ch.vertices[v].getY(), ch.vertices[v].getZ()}); |
| 182 | } |
| 183 | const int32_t nt = ch.faces.size(); |
| 184 | for (int32_t t = 0; t < nt; ++t) |
| 185 | { |
| 186 | const btConvexHullComputer::Edge *sourceEdge = &(ch.edges[ch.faces[t]]); |
| 187 | int32_t a = sourceEdge->getSourceVertex(); |
| 188 | int32_t b = sourceEdge->getTargetVertex(); |
| 189 | const btConvexHullComputer::Edge *edge = sourceEdge->getNextEdgeOfFace(); |
| 190 | int32_t c = edge->getTargetVertex(); |
| 191 | while (c != a) |
| 192 | { |
| 193 | convex.triangles.push_back({(int)a, (int)b, (int)c}); |
| 194 | edge = edge->getNextEdgeOfFace(); |
| 195 | b = c; |
| 196 | c = edge->getTargetVertex(); |
| 197 | } |
| 198 | } |
| 199 | } |
| 200 | |
| 201 | void Model::GetEigenValues(array<array<double, 3>, 3> eigen_values) |
| 202 | { |
nothing calls this directly
no test coverage detected