Weird problem - Physics stop after a while. [Solved]

Squidinc

01-12-2006 17:43:24

Hi, I'm experiencing a rather strange problem since I installed ogreNewt on my project.

Every bodies to which I apply the "standardForceCallBack" act as normal physical bodies for about 4-5 seconds (aka : They fall, bump around, flip, etc..) but after that delay they simply stop working. So I got strange things like spheres floating in mid-air or simply instantly stopping dead while rushing down a slope at full speed.

I've checked OgreNewt's demos and I have the same problem. In demo 1 for example, the cylinders simply stop moving after a while.

That problem happens independently for every bodies. If I throw a new cylinder it will move normally for a while and then stop moving (with the other frozen cylinders still staying frozen).

Also, if I throw a new object at this "frozen" body, it will simply "bump" the frozen body and stop too.

Moreover, I compiled and tested some Newton Dynamics demos (which are not using OgreNewt) and everything seems to work fine, which makes me believe it's OgreNewt related.

I'll try to dig deeper today in order to find what is happenning but I'd be extremely glad if you guys could input some advices (or solutions! :D) I've been pulling my hairs over this for a couple of days.

alberts

01-12-2006 18:40:45

I've checked OgreNewt's demos and I have the same problem. In demo 1 for example, the cylinders simply stop moving after a while.


If I remember correctly this is caused by the size of the world. When a body reach to the limit it freeze.

Also, you may set the autofreeze property of your bodies to false.

Squidinc

01-12-2006 19:07:44

Ahh that makes so much sense.

Thanks for the tip! I'll test that.

trilobite

01-12-2006 19:14:19

There is the Ogre visual world, and the Newton physical world. Ideally, they overlap perfectly.

I wondered abou the same problem I had when I started using OgreNewt and found the solution here on the forum.

alberts is right.

Here is how I do it...
// create the OgreNewt world. this must be done before any other commands can be called.
m_pWorld = new OgreNewt::World();
// necessary to set, otherwise objects stick to invisible walls of small default size world
m_pWorld->setWorldSize(Ogre::AxisAlignedBox(-10000,-10000,-10000,10000,10000,10000));

Squidinc

01-12-2006 19:17:08

Yup, I just (greatly) enlarged my world and now everything's working fine!

Thanks a lot for the help :).