Collisions everywhere

radioactiveman
Posts: 3
Joined: Thu Nov 29, 2012 1:10 pm

Collisions everywhere

Post by radioactiveman »

Hi there,

I tried to make my collision detection faster by using the btGImpactConvexDecompositionShape. Unfortunately I am not able to save my world and import it again because of some unknown type errors. Nevertheless, I took the children of the decomposition and stored the shapes after a Delaunay in a VTK file. After that I read it back, put the points in a btConvexHullShape and those into a btCompoundShape. The Problem is now, that everything seems to collide with everything which means, I actually had 7 pieces decomposed into about 30 each. In the end I have 7 pieces again through the compound shape but all of them are colliding.
The pieces do not have transformations because each point is on the correct position. Do I need transformations or is it okay to use identity?
Why is everything colliding even though some of the parts are more than one meter apart from each other?
Is there a better way to store the btGImpactConvexDecompositionShape and read it back again?

Thanks for your help!

Edit: The Delaunay is just to display the shapes in paraview. For bullet I only use the points.
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Re: Collisions everywhere

Post by Erwin Coumans »

You might need to compute the centroid of the convex hull, shift the vertices around the centroid, and pass in the child transform with the centroid
when adding the convex hull to the btCompoundShape.

If that doesn't work, can you attach the zipped .bullet file of a world that has a rigid body with the btCompoundShape filled with btConvexHullShapes?