| 9 | class BVHTest : public TestBase { |
| 10 | public: |
| 11 | void init_bvh(MeshPtr mesh, typename BVHEngine::Ptr bvh) { |
| 12 | const size_t dim = mesh->get_dim(); |
| 13 | const size_t num_vertices = mesh->get_num_vertices(); |
| 14 | const size_t num_faces = mesh->get_num_faces(); |
| 15 | |
| 16 | VectorF flattened_vertices = mesh->get_vertices(); |
| 17 | MatrixFr vertices(num_vertices, dim); |
| 18 | std::copy( flattened_vertices.data(), |
| 19 | flattened_vertices.data() + num_vertices * dim, |
| 20 | vertices.data()); |
| 21 | |
| 22 | VectorI flattened_faces = mesh->get_faces(); |
| 23 | MatrixIr faces(num_faces, 3); |
| 24 | std::copy( flattened_faces.data(), |
| 25 | flattened_faces.data() + num_faces* 3, |
| 26 | faces.data()); |
| 27 | |
| 28 | bvh->set_mesh(vertices, faces); |
| 29 | bvh->build(); |
| 30 | } |
| 31 | |
| 32 | void assert_centroid_has_zero_dist(MeshPtr mesh, |
| 33 | typename BVHEngine::Ptr bvh, |
nothing calls this directly
no test coverage detected