# Physics Simulation Forum

 All times are UTC

 Page 1 of 1 [ 4 posts ]
 Print view Previous topic | Next topic
Author Message
 Post subject: btConvexHullShape not detecting collisionsPosted: Fri Jun 16, 2017 2:28 pm

Joined: Fri Jun 16, 2017 2:20 pm
Posts: 5
Hi

I am experiencing a problem that colliding with certain btConvexHullShapes does not trigger a contact.
The famous suzanne and teapot objects work when using below method. When using a plane with a hole inside it does not work. If that cannot work please let me know. What I want to achieve is flying a spaceship through a hole in a plane and detecting whether it has collided with the edges of the hole in the plane.

Thanks!

Rupert

I am using the following code:

Code:
btConvexHullShape* shape = new btConvexHullShape();
//btVector3 v;
for (int i = 0; i < m_Entries[0].vertices.size(); i++) {
btVector3 v(m_Entries[0].vertices[i].x, m_Entries[0].vertices[i].y, m_Entries[0].vertices[i].z);
}

shape->optimizeConvexHull();
shape->initializePolyhedralFeatures();

Top

 Post subject: Re: btConvexHullShape not detecting collisionsPosted: Fri Jun 16, 2017 4:44 pm

Joined: Tue Sep 30, 2014 6:03 pm
Posts: 300
Location: San Francisco
You are using a btConvexHullShape which creates a convex hull around the points that you give it. You can feed a teapot to a convex hull but the result won't collide quite like what the teapot looks like. Search for "teapot convex hull" on images.google.com and you'll see some example images of what is going on.

Once you understand what a "convex hull" is, it should be clear why you can't use btConvexHullShape for a plane with a hole inside. You need to use a different shape type, maybe btBvhTriangleMeshShape or you could break the plane+hole into pieces and use btCompoundShape around several btConvexHullShapes.

Top

 Post subject: Re: btConvexHullShape not detecting collisionsPosted: Fri Jun 16, 2017 8:26 pm

Joined: Fri Jun 16, 2017 2:20 pm
Posts: 5
Thank you so much. It looks fine in debugdrawer.

Does it still not work if I am using shape->initializePolyhedralFeatures(); ?

Which approach would you recommend as alternative in terms of speed/ease of use ? btBvhTriangleMeshShape or btCompoundShape ?

Thanks

Greetings, Rupert

Top

 Post subject: Re: btConvexHullShape not detecting collisionsPosted: Sat Jun 17, 2017 1:11 am

Joined: Tue Sep 30, 2014 6:03 pm
Posts: 300
Location: San Francisco
The btBvhTriangleMeshShape works surprisingly well in my experience. However, a body that uses such a shape MUST be static (it can't be dynamic or kinematic). Also, that shape works ok if the mesh doesn't have a high triangle density. That is, a small object with all 10k triangles packed into a small space would be a problem, but 10k triangles spread out over a whole terrain might be ok... where "small" means "small relative to the things that are colliding against it".

If the object must be dynamic I recommend building a btCompoundShape however if you're on a tight time budget I'd say avoid that complexity if possible... unless you are good at 3DStudioMax or Blender and know how to convexify the geometry using those tools.

Top

 Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending
 Page 1 of 1 [ 4 posts ]

 All times are UTC

#### Who is online

Users browsing this forum: Baidu [Spider], Exabot [Bot], Google [Bot] and 23 guests

 You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum

Search for:
 Jump to:  Select a forum ------------------ BULLET PHYSICS LIBRARY USERS    General Bullet Physics Support and Feedback    Release Announcements    Applications, Games, Demos or Movies using Bullet PHYSICS AUTHORING TOOLS, SERIALIZATION AND STANDARDS    Physics authoring tools, serialization, standards and related topics RESEARCH AND DEVELOPMENT IN COLLISION DETECTION & PHYSICS. Don't post Bullet support questions here!    Research and development discussion about Collision Detection and Physics Simulation    Links, Papers, Libraries, Demos, Movies, Comparisons       Non-technical forum and license/patent discussion    Career Opportunities