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

Rotation Questions.

Jan 23, 2010 at 12:35 AM

1) Is there a built in method to rotate a body around a specific point?

2) I've noticed when applying an angle to body.Rotation and that angle is constantly changing the collision of the body with other bodies becomes less reliable and as a result the two bodies go inside each other, is there some way to combat this, will this happen in 3.0?

Jan 23, 2010 at 3:42 AM

You can offset a geometry when you create it. This will cause the rotation to be around the offset point rather than the centroid of the geometry.

If you have a high force on the body (force can come from rotation), the bodies will penetrate each other. When you manipulate rotation manually, you will step outside the "physics world" in the eyes of the engine. Using ApplyTorque() is better in many ways; one of them being that you can't apply instant changes in rotational direction (just like you can't in real life).

To give you an example of what happens in the eyes of the engine:

A large truck is driving on the road. Suddenly it rotates 90 degrees (Pi/2 radians) while maintaining its position. This will cause half of the truck to be inside the road  and the other half to be up in the air. You can't expect this to happen in the real world, and even tho it is possible in physics engines, it is not a good idea to create such an situation. The engine has no way to recover from this, and thus stuff will get stuck inside each other.

3.0 does have a better algorithm for recovering geometries that are stuck inside each other, but it is not created to prevent situations like the one described above. Situations like that should never happen.