Collision problem between CompoundBody and other types
Posted: Sun Mar 27, 2011 2:37 pm
If I create a compound body consisting of three boxes like so: http://i.imgur.com/S80zU.png
And create a 1x1 box and drop it in the box penetrates it (the box of 1x1 was created right in the center 3 units above, it fell down and ended up going through the middle box some way, you can see where it penetrates it): http://i.imgur.com/Kbbuy.png
Odd thing is if I create two compound bodies of the same 3 body shape they collide perfectly: http://i.imgur.com/xFb7Y.png
AND if I create a triangle mesh from the 3 box model (instead of creating the body for that box using a compound object it collides perfectly with the single box: http://i.imgur.com/6i2TM.png
If I create a triangle mesh from the 3 box model and create a dynamic compound body from the three boxes and try to make them collide I get this result (where the three box model on top if dynamic compound, bottom is static mesh): http://i.imgur.com/matwE.png
My theory as of now is that I'm getting the positions of the compound actor wrong, basically I'm saying create three boxes at positions: (-1,1,0),(0,0,0),(1,1,0) and I'm just assuming that settingt he position is done around the origin (i.e. (0,0,0)) but it's likely the position is being set by the average position of all three boxes? Or am I completely off target? If this is the case then how should I set the center position of the model the 3 box compound object is based on?
And create a 1x1 box and drop it in the box penetrates it (the box of 1x1 was created right in the center 3 units above, it fell down and ended up going through the middle box some way, you can see where it penetrates it): http://i.imgur.com/Kbbuy.png
Odd thing is if I create two compound bodies of the same 3 body shape they collide perfectly: http://i.imgur.com/xFb7Y.png
AND if I create a triangle mesh from the 3 box model (instead of creating the body for that box using a compound object it collides perfectly with the single box: http://i.imgur.com/6i2TM.png
If I create a triangle mesh from the 3 box model and create a dynamic compound body from the three boxes and try to make them collide I get this result (where the three box model on top if dynamic compound, bottom is static mesh): http://i.imgur.com/matwE.png
My theory as of now is that I'm getting the positions of the compound actor wrong, basically I'm saying create three boxes at positions: (-1,1,0),(0,0,0),(1,1,0) and I'm just assuming that settingt he position is done around the origin (i.e. (0,0,0)) but it's likely the position is being set by the average position of all three boxes? Or am I completely off target? If this is the case then how should I set the center position of the model the 3 box compound object is based on?