Velocity issue with setCenterOfMassTransform

Eric_A
Posts: 6
Joined: Wed May 06, 2009 4:42 am

Velocity issue with setCenterOfMassTransform

Post by Eric_A »

Howdy there,

So I'm trying to manually change the orientation of a dynamic object using setCenterOfMassTransform, but I'm getting a weird bug where the velocity of the object speeds up when this happens. Based on user input the orientation of the object is changed, and then this change is propagated to the rigid body through setCenterOfMassTransform. Oddly, whenever the user holds down a button to rotate the object it appears to move faster and seemingly loses all effects of outside forces (i.e. friction).

It appears the culprit is the line: m_interpolationLinearVelocity = getLinearVelocity(); in setCenterOfMassTransform, which is apparently overwriting the interpolated velocity for some reason, and thus causing this screwy behavior. I tried commenting out this line and it seemed to have the desired behavior, but I feel like this line is probably there for a reason... If so, what is that reason, and is there a better way I could go about manually changing position & orientation?

Thanks,
Eric Anderson