From c1bc1a3688a12d2ace07fd3c9eccc031bcec54c8 Mon Sep 17 00:00:00 2001 From: Stephen Gold Date: Wed, 13 May 2020 02:30:26 -0700 Subject: [PATCH 1/3] btCollisionObject.h: add getters for m_objectsWithoutCollisionCheck --- .../CollisionDispatch/btCollisionObject.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/BulletCollision/CollisionDispatch/btCollisionObject.h b/src/BulletCollision/CollisionDispatch/btCollisionObject.h index 85dc488c8..3a1c271af 100644 --- a/src/BulletCollision/CollisionDispatch/btCollisionObject.h +++ b/src/BulletCollision/CollisionDispatch/btCollisionObject.h @@ -251,6 +251,16 @@ public: m_checkCollideWith = m_objectsWithoutCollisionCheck.size() > 0; } + int getNumObjectsWithoutCollision() const + { + return m_objectsWithoutCollisionCheck.size(); + } + + const btCollisionObject* getObjectWithoutCollision(int index) + { + return m_objectsWithoutCollisionCheck[index]; + } + virtual bool checkCollideWithOverride(const btCollisionObject* co) const { int index = m_objectsWithoutCollisionCheck.findLinearSearch(co); From bad085554c06f9ac24330bce5717fd46fddad95e Mon Sep 17 00:00:00 2001 From: Chuyuan Fu Date: Fri, 15 May 2020 14:19:23 -0700 Subject: [PATCH 2/3] set collision margin for implicit cynlinder --- examples/Importers/ImportURDFDemo/BulletUrdfImporter.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/Importers/ImportURDFDemo/BulletUrdfImporter.cpp b/examples/Importers/ImportURDFDemo/BulletUrdfImporter.cpp index ec0cba28f..ea4bf272f 100644 --- a/examples/Importers/ImportURDFDemo/BulletUrdfImporter.cpp +++ b/examples/Importers/ImportURDFDemo/BulletUrdfImporter.cpp @@ -623,7 +623,7 @@ btCollisionShape* BulletURDFImporter::convertURDFToCollisionShape(const UrdfColl btScalar height = collision->m_geometry.m_capsuleHeight; btCapsuleShapeZ* capsuleShape = new btCapsuleShapeZ(radius, height); shape = capsuleShape; - shape->setMargin(gUrdfDefaultCollisionMargin); + shape->setMargin(gUrdfDefaultCollisionMargin); break; } @@ -636,6 +636,7 @@ btCollisionShape* BulletURDFImporter::convertURDFToCollisionShape(const UrdfColl btVector3 halfExtents(cylRadius, cylRadius, cylHalfLength); btCylinderShapeZ* cylZShape = new btCylinderShapeZ(halfExtents); shape = cylZShape; + shape->setMargin(gUrdfDefaultCollisionMargin); } else { From c87cda15b79ff28a64ed357b487c118b0aa30bf6 Mon Sep 17 00:00:00 2001 From: Chuyuan Fu Date: Fri, 15 May 2020 14:21:06 -0700 Subject: [PATCH 3/3] fix space --- examples/Importers/ImportURDFDemo/BulletUrdfImporter.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/Importers/ImportURDFDemo/BulletUrdfImporter.cpp b/examples/Importers/ImportURDFDemo/BulletUrdfImporter.cpp index ea4bf272f..3dd26eb4b 100644 --- a/examples/Importers/ImportURDFDemo/BulletUrdfImporter.cpp +++ b/examples/Importers/ImportURDFDemo/BulletUrdfImporter.cpp @@ -623,7 +623,7 @@ btCollisionShape* BulletURDFImporter::convertURDFToCollisionShape(const UrdfColl btScalar height = collision->m_geometry.m_capsuleHeight; btCapsuleShapeZ* capsuleShape = new btCapsuleShapeZ(radius, height); shape = capsuleShape; - shape->setMargin(gUrdfDefaultCollisionMargin); + shape->setMargin(gUrdfDefaultCollisionMargin); break; } @@ -636,7 +636,7 @@ btCollisionShape* BulletURDFImporter::convertURDFToCollisionShape(const UrdfColl btVector3 halfExtents(cylRadius, cylRadius, cylHalfLength); btCylinderShapeZ* cylZShape = new btCylinderShapeZ(halfExtents); shape = cylZShape; - shape->setMargin(gUrdfDefaultCollisionMargin); + shape->setMargin(gUrdfDefaultCollisionMargin); } else {