(un)Freezing doesn't work

Ajare

23-01-2007 20:18:17

body::freezeAll works as I expect, which is to say the body stops moving entirely. However unFreezeAll doesn't do anything, nor in fact do any of the unFreeze functions once I've frozen a body. Moreover, when I call unFreezeAll without freezing beforehand, I get an exception.

All I'm doing is


mBody = scene->createBody (name, "", new nxOgre::cubeShape (size, localPos, actorMat), 5, pos);

...

mBody->freezeAll ();

...

mBody->unFreezeAll ();


On another note, I notice that the code could be tidied up a bit - you're passing a lot of stuff by value where it'd be better to pass as const references, and using sequential if statements where an if-elseif would be quicker. Something for the todo list? :D

betajaen

23-01-2007 21:04:02

Hmm, works for me:

mWorld = new world();
mScene = mWorld->createScene("Main", mSceneMgr);
mScene->hasGravity();
mScene->hasFloor();
myCube = mScene->createBody (.....);
myCube->freezeMovement(Vector3(1,0,1));
myCube->unFreezeAll();

Ajare

28-01-2007 17:02:43

Ok, this is bizarre:

edit: removed some stuff I wrote which wasn't accurate.

With a falling (under gravity) body, it only unfreezes (once frozen) if it was moving in the XZ plane as well at the time in which it was frozen. I will update when/if I discover more.

The bodies are of course dynamic, non-kinematic, default group.

This is using Ogre 1.2.4, nxOgre 0.4RC3 and PhysX 2.6.0 (according to nxOgre log).