Skip to content

Commit

Permalink
feat: Test trigger boxes
Browse files Browse the repository at this point in the history
  • Loading branch information
AWildErin committed May 24, 2024
1 parent 2351e4d commit f2a0a6c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions include/cbreader/rmesh.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ struct Mesh
{
std::vector<Surface> surfaces;

/** Only valid for TriggerBoxes */
std::string name;
};

Expand Down
7 changes: 7 additions & 0 deletions test/test_rmesh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,13 @@ TEST(RMesh, read_triggerboxes)
EXPECT_EQ(rmesh.collisionMesh.surfaces[0].vertices.size(), 18);
EXPECT_EQ(rmesh.collisionMesh.surfaces[0].triangles.size(), 8);

// Test trigger boxes
EXPECT_EQ(rmesh.triggerBoxes.size(), 3);
EXPECT_STREQ(rmesh.triggerBoxes[0].name.data(), "173scene_timer");
EXPECT_STREQ(rmesh.triggerBoxes[1].name.data(), "173scene_activated");
EXPECT_STREQ(rmesh.triggerBoxes[2].name.data(), "173scene_end");


// Test the first 2 model entities
EXPECT_STREQ(rmesh.modelEntities[0].className.data(), "model");
EXPECT_STREQ(rmesh.modelEntities[0].path.data(), "lamp2.x");
Expand Down

0 comments on commit f2a0a6c

Please sign in to comment.