Release Mode Problem: position goes crazy

pra

15-04-2008 19:12:16

I just encountered a very nasty problem: as soon as the scene is created (i can even see it for some milliseconds), my player's body's position suddenly turns -1.#IND -1.#IND -1.#IND
It happens only in release mode, and only if I start the exe directly, if i try to debug in release mode, it does not occur, therefore i know next to nothing what happens...
i put several logging lines in the force callback and in the update function (it is called every frameStarted)

in the callback:
mBody->addForce((movAccel+gravAccel) * mMass);

mLog("force added="+str((movAccel+gravAccel) * mMass));
mLog("newton time="+str(mWorld->getTimeStep()));
mLog("callback pos="+str(getPosition()));

(mMass is 60, gravAccel is -9,81 and movAccel is 0)
and in update:
Vector3 mPos = getPosition();
mLog("time="+str(time));
mLog("mPos="+str(mPos));
mLog("vel="+str(mBody->getVelocity()));

(time is FrameEvent::timeSinceLastFrame)
output is like this:

20:05:09: PRA: time=0.001
20:05:09: PRA: mPos=-9.75 15.25 -3.25
20:05:09: PRA: vel=0 0 0
(these 3 lines repeat several times with nothing else in between)
20:05:09: PRA: time=0.001
20:05:09: PRA: mPos=-9.75 15.25 -3.25
20:05:09: PRA: vel=0 0 0
20:05:09: PRA: force added=0 -588.6 0
20:05:09: PRA: newton time=0.0166667
20:05:09: PRA: callback pos=-9.75 15.25 -3.25
20:05:09: PRA: time=0.002
20:05:09: PRA: mPos=-1.#IND -1.#IND -1.#IND
20:05:09: PRA: vel=-1.#IND -1.#IND -1.#IND

after the first time the callback is called, position and velocity explode and stay that way.
If i reload the level (without restarting the app), it usually works fine, but sometimes not. If I restart it, the problem will always occur.

i'm updating my world like this:
mWorldElapsed += time;
mWorldUpdate = (float)((1.0f)/(60.0f));

while(mWorldElapsed > mWorldUpdate)
{
mWorld->update(mWorldUpdate);
mWorldElapsed -= mWorldUpdate;
}


edit: just updated to the latest version from walaber.com. no effect.

edit2: what version is the latest, cvs or walaber.com? the one from cvs says "current version: 0.10", and the one from walaber.com 0.11...

edit3: yes, it occurs when the world is updated the first time

edit4: ok, the walaber.com version is the old one. it still has the broken scene parser

edit5: i can provoke this error by updating the world right after the scene was created. I mean, this way it also occurs while debugging in debug mode

pra

15-04-2008 21:59:09

found a workaround: if I wait at least 0.85 seconds after scene creation before I start updating the world, it seems to work...