NxUserContactReport with NxOgre (Detritus)

dronbas

02-03-2011 09:59:56

Hello!
When bodies collide I need to get contact points, separation and other parameters of the collision which are available in PhysX in NxContactPair.stream, which can be iterated using NxContactStreamIterator. As I understand NxOgre doesn't provide such a stream (Tell me if I am wrong). That's why I created a new class derived from NxUserContactReport, registered it in the scene using setUserContactReport. While I call mWorld->advance(...) in NxOgre I begin to receive collision notifications and save them. After this call I process these notifications (simply write them into log). So it looks like
while (bWorking)
{
mWorld->advance(...);
processCollisionReport(); // write all contact pairs into log
clearCollisionReport(); // clear the list of contact pairs
}

While collision happens objects are not moving (a raised NX_AF_DISABLE_RESPONSE) and I clearly see that objects are interpenetrating as I expect. I continue to get contact notifications.

The strange thing is that it seems that not all notifications are received during the call mWorld->advance(). For example each frame I get 2 contact pairs in my collision report list. And then suddenly I get 1 and next frame 3 contact pairs. I thought that I should wait for PhysX to send all contact notifications and added this code after mWorld->advance():
mScene->getScene()->flushStream(); // mScene is NxOgre::Scene
mScene->getScene()->fetchResults(NX_RIGID_BODY_FINISHED, true);
But during the fetchResults I get an exception which tells that "method called with invalid parameter(s)".
What do I do wrong?How can I ensure that I've received all collision pairs for the scene?

AfyDriver

02-11-2011 13:39:43

????
and now ??
no solution ?