Compound Bodies
Posted: Fri Nov 30, 2012 2:39 pm
Hello Norbo,
First of, thanks again for this awesome library! I still can't believe this is in C# and so efficient
I had asked a question about this a while ago, and I'm still very confused about the mass/transforms implications in CompoundBodies.
What I'm trying to do is have a vehicle that has weights unevenly placed on its chassis, kind of like a tank with a heavy plate in the back side.
I modified the vehicle in the demos to show what I want to achieve:
http://i.imgur.com/RrQDk.png
In this example, the top box's mass is still set to the default of 1.0 while the bottom box is at 60 like in the demo.
Now, I'd like to make the top box so it weights a lot more, about 60 as well. Unfortunately, when I do this, here is what is looks like:
http://i.imgur.com/6L8FM.png
Reading the doc and other forum posts, this behavior is expected, but I'm not sure how to make it so the car wheels are still in the correct position in relation to the boxes.
How would you modify the sample so it would look like my 1st screenshot (wheels correctly placed), but with the back side suspension being more compressed due to the weight of the second box.
Just in case, here's the code I have for the modified demo vehicle:
Thanks!
First of, thanks again for this awesome library! I still can't believe this is in C# and so efficient

I had asked a question about this a while ago, and I'm still very confused about the mass/transforms implications in CompoundBodies.
What I'm trying to do is have a vehicle that has weights unevenly placed on its chassis, kind of like a tank with a heavy plate in the back side.
I modified the vehicle in the demos to show what I want to achieve:
http://i.imgur.com/RrQDk.png
In this example, the top box's mass is still set to the default of 1.0 while the bottom box is at 60 like in the demo.
Now, I'd like to make the top box so it weights a lot more, about 60 as well. Unfortunately, when I do this, here is what is looks like:
http://i.imgur.com/6L8FM.png
Reading the doc and other forum posts, this behavior is expected, but I'm not sure how to make it so the car wheels are still in the correct position in relation to the boxes.
How would you modify the sample so it would look like my 1st screenshot (wheels correctly placed), but with the back side suspension being more compressed due to the weight of the second box.
Just in case, here's the code I have for the modified demo vehicle:
Code: Select all
var bodies = new List<CompoundShapeEntry>()
{
new CompoundShapeEntry(new BoxShape(2.5f, .75f, 4.5f), new Vector3(0, 0, 0), 60),
new CompoundShapeEntry(new BoxShape(2.5f, .3f, 2f), new Vector3(0, .75f / 2 + .3f / 2, 3.5f), 60)
};
var body = new CompoundBody(bodies, 120);