Add maxhullvert.
PiperOrigin-RevId: 641092710 Change-Id: Ib4fa828a9c82531614f0a67de9990340dbb25406
This commit is contained in:
committed by
Copybara-Service
parent
fb8bf206d9
commit
ace0c8f0a3
+8
@@ -0,0 +1,8 @@
|
||||
<mujoco>
|
||||
<asset>
|
||||
<mesh file="torus.obj" maxhullvert="4"/>
|
||||
</asset>
|
||||
<worldbody>
|
||||
<geom type="mesh" mesh="torus"/>
|
||||
</worldbody>
|
||||
</mujoco>
|
||||
@@ -0,0 +1,11 @@
|
||||
<mujoco>
|
||||
<default>
|
||||
<mesh maxhullvert="64"/>
|
||||
</default>
|
||||
<asset>
|
||||
<mesh file="torus.obj"/>
|
||||
</asset>
|
||||
<worldbody>
|
||||
<geom type="mesh" mesh="torus"/>
|
||||
</worldbody>
|
||||
</mujoco>
|
||||
@@ -41,6 +41,10 @@ static const char* const kCubePath =
|
||||
"user/testdata/cube.xml";
|
||||
static const char* const kTorusPath =
|
||||
"user/testdata/torus.xml";
|
||||
static const char* const kTorusMaxhullVertPath =
|
||||
"user/testdata/torus_maxhullvert.xml";
|
||||
static const char* const kTorusDefaultMaxhullVertPath =
|
||||
"user/testdata/torus_maxhullvert_default.xml";
|
||||
static const char* const kTorusShellPath =
|
||||
"user/testdata/torus_shell.xml";
|
||||
static const char* const kConvexInertiaPath =
|
||||
@@ -405,6 +409,25 @@ TEST_F(MjCMeshTest, TinyMeshLoads) {
|
||||
mj_deleteModel(model);
|
||||
}
|
||||
|
||||
// ------------- test max hull vert -------------------------------------------
|
||||
TEST_F(MjCMeshTest, MaxHullVert) {
|
||||
const std::string xml_path = GetTestDataFilePath(kTorusMaxhullVertPath);
|
||||
std::array<char, 1024> error;
|
||||
mjModel* model = mj_loadXML(xml_path.c_str(), 0, error.data(), error.size());
|
||||
ASSERT_GT(model->ngeom, 0);
|
||||
ASSERT_EQ(model->mesh_graph[0], 4);
|
||||
mj_deleteModel(model);
|
||||
}
|
||||
|
||||
TEST_F(MjCMeshTest, MaxHullVertDefault) {
|
||||
const std::string xml_path = GetTestDataFilePath(kTorusDefaultMaxhullVertPath);
|
||||
std::array<char, 1024> error;
|
||||
mjModel* model = mj_loadXML(xml_path.c_str(), 0, error.data(), error.size());
|
||||
ASSERT_GT(model->ngeom, 0);
|
||||
ASSERT_EQ(model->mesh_graph[0], 64);
|
||||
mj_deleteModel(model);
|
||||
}
|
||||
|
||||
// ------------- test inline loading ------------------------------------------
|
||||
TEST_F(MjCMeshTest, FaceNormalAutogenerated) {
|
||||
static constexpr char xml[] = R"(
|
||||
|
||||
Reference in New Issue
Block a user