interpolate loc/rot with python to smooth out movement?

ok, basically i have a dynamic object (actor+dynamics+rigidbody+nosleep) that the user controls with a range of keyboard-based movement, now the problem is that I need to somehow dampen the movement of this object.

basically i want something like this:

set_current_loc_and_rot = (current_loc_and_rot + last_frame_loc_and_rot) / 2

if it possible with python?

and no ‘form factor’ and ‘damping’ isn’t what i am looking for. I need a way to truly smooth out the movement of an object.

I think you may be reffering to the effects of the “friction shake bug” in 2.42.

If so, you can find a workaround to this problem in this thread:

well not quite, the effect is due to the way my object is colliding frequently with environmet with large force, i want to reduce the jerkiness of the collision by incoporate an ‘averaging filter’ so that it my objects gets cushioned on impact.

Think of it as i want to get the object to behave as if it is striking something soft, like a pillow, rather than a brick wall.

Oh, now I see.

I don’t think there is a way to pull it off though (at least not a good one) because it sounds like a physics engine specific issue.

You could try applying counterforce with a python script just before the hit. You can use “getLinearVelocity” multiply the xyz values by -1, then divide the same values by 2, and then feed the result to “setLinearVelocity”.

thanks for your help social, will give it a try tomorrow.

Social’s right, I’ve made a cool hovercar effect with an opposing force applied. It worked the way you’re talking about.

ok, the problem is that I have almost 1 collision per second (it’s an irregular object rolling on a bumpy terrain), i want to achieve an effect so that it behaves as if the object is rolling on soft snow.

I’ve tried the counter-force method but it doesn’t work too well, maybe it just requires more tweaking…

I am also experiementing using a ‘camera’ track-to actuator to smooth out the movement of the object by setting the original mesh to invisible and let a second ‘non-dymanic’ mesh to track to the first one. this works pretty well except for the rotations… Any comments on this method?