I have an object (a cube) with a center of mass offset from the transforms center. If I apply forces in front and behind the cube to induce a spin on the object it will rotate around the center of mass rather than the center position of the transform as it should. Imagine holding a pencil between two fingers and pushing each end in opposite directions so the pencil spins in place.
However I would like to know if it’s possible to calculate the forces such that without changing the position they act on they can provide different amounts of force to cause the object to rotate around the transforms center and not the center of mass. Basically I want to counter the uneven distribution of mass so that it appears to rotate around its center. Common sense is telling me this should be possible by applying a greater force on the end closest to the center of mass but I could be way off here. Any help with this would be greatly appreciated.
I’d think it’s not doable for two reasons: how the program works, and how real physics works.
In practice, it seems easier just to temporarily change the CenterOfMass yourself (very easy to do in code.) Alternately, have code put a temporary hinge joint at the “spin around” spot (attached to just nothing – counts as being glued to “the scene”.)
Coding, I believe that angularVelocity is applied as a spin around the center of mass. So any combination of shoves will result in a straight-line velocity with a spin around the CoM (in the pencil example, the velocities cancel, leaving only the spin, which is the point.)
In real physics, I think the same math appiles. The centerOfMass is the single point the object “counts as being.” Like how you can treat the entire earth as being at the center of the planet for gravity. Spinning around the CoM is like being stationary. Spinning around not-the-CoM is like moving in a circle while also spinning at the same rate (so that some non-CoM point isn’t moving.) An object isn’t naturally going to move in a circle unless something forces it to – a spinning top has the friction of the tip on the table to do that. There’s also some gyroscope effect(?) which I’m 99% sure PhyX doesn’t handle.
In other words, clamp a heavy paper clip near the end of a plastic straw and try to spin it around the center. I think it can’t be done, and any attempt will simply use the torque to launch the paper-clip like a catapult (dragging the spinning straw with it.)