How exactly does Newton calculate center of mass (COM) when the body has compound collisions?
I am getting unexplained center of mass offsets, even though my compound collisions are perfectly axial. What I have are rocket parts, basically a bunch of cylinders and cones all stacked on top of each other, that are perfectly aligned axially. However, when I check body's COM:
- Code: Select all
NewtonBodyGetCentreOfMass(body, &com[0]);
I get small offsets that shouldn't be there. They are small, but when I fire an axially mounted rocket engine, the small COM offset gives a small torque on lateral axis and the rocket part starts to spin.
I fixed this by forcing COM to zero after I assemble my rocket body from compounds:
- Code: Select all
dVector origin = dVector(0.0f, 0.0f, 0.0f);
NewtonBodySetCentreOfMass(newEntity->nBody, &origin[0]);
however - if my compounds are symmetrical, exact and aligned, I shouldn't have to do that, correct? Also - I am sure I will one day need to construct a rocket part that's asymmetrical, and I'd like to rely on Newton to compute the exact COM...
Thanks
Misho