This project has moved and is read-only. For the latest updates, please go here.

Is there a way to stop rotational torque from collisions?

Apr 9, 2009 at 7:42 AM
In my friendly neighborhood pong game, I need the player to control all rotation of the paddle. As such, I've mapped rotation to the right stick. However, I'm still getting rotation when the ball hits the paddle. I don't really want to rely on setting the ball's mass to be super tiny, because some of the powerups in the game will change the mass of the ball.

I obviously can't just set the body's rotation to 0 every frame, because that wouldn't allow for user rotation.

Anyone have an idea? I can post code, but there's alot that could be affected, so I was hoping there might be a general solution I didn't see when I pored through the source.

I'm gonna keep plugging away, thanks for any advice.

Apr 9, 2009 at 6:38 PM
Edited Apr 9, 2009 at 6:38 PM
You could set the moment of inertia to positive infinity
body.momentofininertia = float.positiveinfinity;
this will stop it from rotating from torque(collisions, apply torque, etc will no longer rotate it)
however you can still set the body.rotation and change that however you like
That should work perfect