37 #include "resources/config.h" 39 #include <gtest/gtest.h> 46 ASSERT_TRUE(mesh != NULL);
54 ASSERT_FLOAT_EQ(0, mesh->
vertices[0 + 0]);
55 ASSERT_FLOAT_EQ(0, mesh->
vertices[0 + 1]);
56 ASSERT_FLOAT_EQ(1, mesh->
vertices[0 + 2]);
57 ASSERT_FLOAT_EQ(0, mesh->
vertices[3 + 0]);
58 ASSERT_FLOAT_EQ(1, mesh->
vertices[3 + 1]);
59 ASSERT_FLOAT_EQ(0, mesh->
vertices[3 + 2]);
60 ASSERT_FLOAT_EQ(1, mesh->
vertices[6 + 0]);
61 ASSERT_FLOAT_EQ(0, mesh->
vertices[6 + 1]);
62 ASSERT_FLOAT_EQ(0, mesh->
vertices[6 + 2]);
67 std::string path =
"file://" + std::string(TEST_RESOURCES_DIR) +
"/" + mesh;
74 assertMesh(loadMesh(
"triangle.stl"));
79 assertMesh(loadMesh(
"triangle_no_up.dae"));
84 assertMesh(loadMesh(
"triangle_y_up.dae"));
89 assertMesh(loadMesh(
"triangle_z_up.dae"));
94 assertMesh(loadMesh(
"triangle_x_up.dae"));
97 TEST(CreateMesh, daeNoUnit)
99 assertMesh(loadMesh(
"triangle_no_unit.dae"));
104 assertMesh(loadMesh(
"triangle_1m.dae"));
109 assertMesh(loadMesh(
"triangle_10m.dae"));
112 int main(
int argc,
char** argv)
114 testing::InitGoogleTest(&argc, argv);
115 return RUN_ALL_TESTS();
unsigned int * triangles
The vertex indices for each triangle triangle k has vertices at index (3k, 3k+1, 3k+2) = (v1...
unsigned int vertex_count
The number of available vertices.
unsigned int triangle_count
The number of triangles formed with the vertices.
double * vertices
The position for each vertex vertex k has values at index (3k, 3k+1, 3k+2) = (x,y,z)
Mesh * createMeshFromResource(const std::string &resource)
Load a mesh from a resource that contains a mesh that can be loaded by assimp.
Definition of a triangle mesh By convention the "center" of the shape is at the origin. For a mesh this implies that the AABB of the mesh is centered at the origin. Some methods may not work with arbitrary meshes whose AABB is not centered at the origin.
int main(int argc, char **argv)