Skip to content

Commit

Permalink
support convex hull
Browse files Browse the repository at this point in the history
Signed-off-by: Ian Chen <[email protected]>
  • Loading branch information
iche033 committed Mar 14, 2024
1 parent 5a4d561 commit 467a449
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions bullet-featherstone/src/SDFFeatures.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1060,10 +1060,22 @@ bool SDFFeatures::AddSdfCollision(
{
auto s = mesh->SubMeshByIndex(submeshIdx).lock();
bool meshCreated = false;
if (meshSdf->Simplification() == "convex_decomposition")
if (meshSdf->Simplification() ==
::sdf::MeshSimplification::CONVEX_DECOMPOSITION ||
meshSdf->Simplification() ==
::sdf::MeshSimplification::CONVEX_HULL)
{
std::vector<common::SubMesh> decomposed;
decomposed = meshManager.ConvexDecomposition(s.get());
if (meshSdf->Simplification() == ::sdf::MeshSimplification::CONVEX_HULL)
{
/// create 1 convex hull for the whole submesh
decomposed = std::move(meshManager.ConvexDecomposition(*s.get(), 1u));
}
else
{
/// decompose into multiple convex hulls
decomposed = std::move(meshManager.ConvexDecomposition(*s.get()));
}
gzdbg << "Simplifying mesh using convex decomposition. " << std::endl;
if (!s->Name().empty())
gzdbg << " Submesh: " << s->Name() << std::endl;
Expand Down

0 comments on commit 467a449

Please sign in to comment.