Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bullet TesseractCompoundCollisionAlgorithm bugfix #1008

Merged
merged 3 commits into from
May 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions tesseract_collision/bullet/src/convex_hull_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,7 @@ int createConvexHull(tesseract_common::VectorVector3d& vertices,
for (int i = 0; i < num_verts; i++)
{
btVector3& v = conv.vertices[i];
vertices.push_back(
Eigen::Vector3d(static_cast<double>(v.getX()), static_cast<double>(v.getY()), static_cast<double>(v.getZ())));
vertices.emplace_back(static_cast<double>(v.getX()), static_cast<double>(v.getY()), static_cast<double>(v.getZ()));
}

auto num_faces = static_cast<size_t>(conv.faces.size());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,12 +164,27 @@ struct TesseractCompoundLeafCallback : btDbvt::ICollide

if (TestAabbAgainstAabb2(aabbMin0, aabbMax0, aabbMin1, aabbMax1))
{
#if BT_BULLET_VERSION >= 300
btTransform preTransform = childTrans;
if (this->m_compoundColObjWrap->m_preTransform != nullptr)
{
preTransform = preTransform * (*(this->m_compoundColObjWrap->m_preTransform));
}
btCollisionObjectWrapper compoundWrap(this->m_compoundColObjWrap,
childShape,
m_compoundColObjWrap->getCollisionObject(),
newChildWorldTrans,
preTransform,
-1,
index);
#else
btCollisionObjectWrapper compoundWrap(this->m_compoundColObjWrap,
childShape,
m_compoundColObjWrap->getCollisionObject(),
newChildWorldTrans,
-1,
index);
#endif

btCollisionAlgorithm* algo = nullptr;
bool allocatedAlgorithm = false;
Expand Down
Loading