When a dynamic body is made, the CoG seems to be set as the center of volume of the shape. The CoG is then the same as the object's position, and the points in the object's shape are in relation to that position.
Is it possible to adjust the CoG after creating a body?
Say, if you wanted to simulate a body with a drasticly odd distribution of mass. Like an hourglass, with all the sand in one side, or a race car, with it's mass close to the floor.
If not, is it possible to use a compound body to get that result? (each half of the hourglass would be it's own entry with it's own mass. When combined, the CoG would be closer to the full side)
Adjust center of gravity?
Adjust center of gravity?
Last edited by preen on Sun Sep 25, 2011 3:11 am, edited 1 time in total.
Re: Adjust center of gravity?
Yup, by offsetting the collision shape:Is it possible to adjust the CoG after creating a body?
Code: Select all
entity.CollisionInformation.LocalPosition = new Vector3(0,1,0);
Re: Adjust center of gravity?
That approach would also work.is it possible to use a compound body to get that result? (each half of the hourglass would be it's own entry with it's own mass. When combined, the CoG would be closer to the full side)
Re: Adjust center of gravity?
That does the trick, thanks Norbo.