Odd Box behaviour

Amnuriak

16-10-2009 13:28:56

First, here's how to get to this situation:

float wallThickness = 1;
NxOgre::Vec3 sizeVec(10, 10, 10);
float posX, posY, posZ; // makes example easier to read

// bottom
NxOgre::Box* pBottomBox = new NxOgre::Box(sizeVec.x, wallThickness, sizeVec.z);

// left side
NxOgre::Box* pLeftBox = new NxOgre::Box(wallThickness , sizeVec.y + wallThickness, sizeVec.z);
posX = sizeVec.x / 2.0 + wallThickness / 2.0;
posY = sizeVec.y / 2.0 + 0.01;
posZ = 0;
pLeftBox->setLocalPose(NxOgre::Matrix44(NxOgre::Vec3(posX, posY, posZ)));

These make up the shapes of a (compound) actor - let's say Actor1.

Actor1 behaves perfectly fine, that is it falls down (given some sensefull gravity) and given some "ground" it will come to rest upon it quite soon. The visual debugger will mark the actor as sleeping.

Now, let's change just one tiny bit of code:
From
posY = sizeVec.y / 2.0 + 0.01;
to
posY = sizeVec.y / 2.0;

This is all it takes to make the actor always-awake meaning it will never be put to sleep. This implies the actor is actually moving or in a group of actors with at least one actor moving - yet there only is one actor beside the "ground" plane which is static. Even if there was another actor it would not make sense since the same actor ccould come to rest with the exact same environment just before. So it must be the change of properties within the actor to cause the change of energy - meaning the slight position change of the second shape ("left side"). Is this supposed to happen ? I think not.

The small change only made the second shape also come into contact with the ground plane so I suppose the first shape triggers collision detection and passes its information to the second shape while the second shape does so as well, passing its data to the first shape which then processes the data, sends it back to the second shape which loops and loops and loops and so on. I figured this might be due to some inaccuracy which would dissolve over time but even after 30 minutes it would not do so.

My application requires these two boxes to come to rest after a short time, given no other influences then gravity. Otherwise they will trigger other actors in their proximity to be awake as well which will have fatal influences on my whole application. Can someone tell me what this is due to and how to approach this problem ?

Amnu

Amnuriak

20-10-2009 13:28:47

No one got a clue what's going on here ?