beginner question: convex hull shapes gaps

karloscampus
Posts: 1
Joined: Tue Oct 12, 2010 9:27 pm

beginner question: convex hull shapes gaps

Post by karloscampus »

hi everyone,

at first, sorry for my bad english.. ;/

i am going to create some 2d-convex hulls (currently just 2d boxes), which are going to fall on a btplanerplaneShape (at pos y: -10, everything in 2d space).
everything works great, except somehow there is a gap, when the boxes has fallen on the ground, then i look at the exact coordinates. in detail, then a box has the hull ((-2,-2),(-2,2),(2,2),(2,-2)) somehow the middle of the box is not at -8 but instead at about -8.02. so a little bit taller then expected. the gap accumulates continuously, then i stack more then one box on each other.

so what is the problem? ;)

thanks a lot,

karloscampus
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Re: beginner question: convex hull shapes gaps

Post by Erwin Coumans »

If you are using the btConvex2dShape, it might be because of the collision margin. In general it is best not to change the margin or set it to zero, it might create stability issues.

There is a way to shrink the convex hull, so it matches the graphics geometry. I don't have a link handy right now.
Thanks,
Erwin