[PhysX] inaccurate contact position/normal, bug ?

Started by
1 comment, last by greg2fs 13 years, 12 months ago
Hi, I am using physx for some months and enjoy all its great features but I currently trying to get the contact normal or position and if I get the right position at low speed, when it goes faster I clearly see the position returned is like one frame older at a 't' time. Is it a bug or is there something I misunderstood ? Thanks
Advertisement
Do you have any multithreading enabled in physx? Are you doing any multithreading yourself?

Do you process the physics before determining the resultant graphics before drawing the graphics?

There are a few ways this can happen, but unless you've enabled multithreading in physx it does not need to happen.
This is what I do each frame:


gScene->simulate(float(ifps)/500);
gScene->flushStream();
while (!gScene->fetchResults(NX_RIGID_BODY_FINISHED, false));

//retreiving matrices
//rendering objects

I use NxUserContactReport to get contact position.
In fact I am not sur it's just a delay problem because I have a sphere rolling on the floor, if I show the contact position it is not on the floor like if it was a delay issue but at the rear of the sphere like if it was the last frame contact sphere relative position, but I think my sentence is not very clear, see this video:


The dark area is a simple sprite witch have to be at the contact position but as you see the faster the wheel rotate the highter the sprite goes.

This topic is closed to new replies.

Advertisement