Removing collision torque

Hi there,



i am trying to set the torque resultant from collision to zero but i dont know to do that…



I am using dynamicPhysicsNode.clearTorque() on the simpleUpdate().



I think that the collision torque is calculater after the simpleUpdate() method.



Can anyone help me?


Maybe this can be done in a contact callback? After a collision you can clear the torque. There is a test in jME physics, TestContactCallback. I'm not sure if that will help, but you can look into it.

You cannot do this, I think (I assume you use the ODE impl). The tourque results from the lcp solver and is applies directly after that (both in native ODE code). Your best bet is to reset rotations and angular velocities after the update of the physics space.

irrisor said:

You cannot do this, I think (I assume you use the ODE impl). The tourque results from the lcp solver and is applies directly after that (both in native ODE code). Your best bet is to reset rotations and angular velocities after the update of the physics space.


Ok, i shall try that!

But, will it avoid the torque? i mean, even if a node collide in a way that could cause torque will it's toque be null?

One more thing, i implemented the simpleUpdate() method so, i can't do anything until the next loop. How can i do something after teh update an before the torque calculation? is it possible?

thx for any help  :D

Take a look at TestFrictionCallback.

maybe this is what you are looking for.

I think that you'll get into a lot of trouble if you just reset the rotations and angular velocities after collisions because the translation of your node will not be consistent with the rotation you reset, thus allowing objects to go through obstacles.



If you are going to reset rotations and angular velocities at least make also sure that you reset position to the last known correct position. I hope this can save you some trouble.



Hope it helps.