Rotating small physic bodies

May 20, 2007 at 3:56 PM
Hi crashlander and everybody else,

I've got an issue with rotating small physic bodies. It only occurs with bodies that are smaller than about 75f x 75f. I've created the problem with three different types of bodies:

1) With a RectangleRigidBody
2) With a PolygonRigidBody
3) With a PointRigidBody

I am rotating them by using ApplyTorque (float value taken from the xbox controller). If a large amount of spin is applied to the object, it spins ridiculously fast before freezing my computer up completely.

Is there a limitation to the size of an object that can be rotated? Maybe it is something to do with the mass? I tried setting it to different values but it made no difference. Maybe it is a hardward limitation? I'm running the game on a Dell laptop Inspiron 1300 (1.4Gz Celeron with 256Mb memory).

Thanks in advance,
SuperArmySoldier.
Coordinator
May 21, 2007 at 4:37 PM
you are probably over flowing the AngularVelocity. Try bumping up the rotational drag coeficient. This should help keep the simulator from "blowing up".

With any physics engine you need to me mindful what forces and torques you are applying. You need to keep things realistic or you risk pushing the physics to limits the computer can't handle.
May 26, 2007 at 6:27 PM
Hi Crashlander. I tried setting the RotationalDragCoefficient to a very large value (2000000f) and it made no difference. In fact, this made the program crash when I rotated the object without hitting it into to anything. So I tried the opposite, I set the RotationalDragCoefficient down to 100f and it stopped the program from crashing when I hit the object into another.

After playing around with changing the size of the rigid body and the RotationalDragCoefficient I have found that the smaller the body the lower the RotationalDragCoefficient has to be set to stop the spinning out of control problem.

Is this an issue you have seen before? Hopefully it is just an issue with my code. Now I know how to stop this from happening.

Thanks as always,
SuperArmySoldier.
Coordinator
May 29, 2007 at 11:23 AM

superArmySoldier wrote:
Hi Crashlander. I tried setting the RotationalDragCoefficient to a very large value (2000000f) and it made no difference. In fact, this made the program crash when I rotated the object without hitting it into to anything. So I tried the opposite, I set the RotationalDragCoefficient down to 100f and it stopped the program from crashing when I hit the object into another.

After playing around with changing the size of the rigid body and the RotationalDragCoefficient I have found that the smaller the body the lower the RotationalDragCoefficient has to be set to stop the spinning out of control problem.

Is this an issue you have seen before? Hopefully it is just an issue with my code. Now I know how to stop this from happening.

Thanks as always,
SuperArmySoldier.


I think it's just a matter of tuning your physics settings. Different size objects will require different rotational drag coeficients depending on how much torque you are applying.