1
0
mirror of https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git synced 2025-07-20 12:19:10 +00:00

Rework PhysX collision flutter bug workaround

To better handle erroneous trigger events under the new timing method, use the number
of times the simulation has actually advanced instead of the number of evals received.

Cleaned up a bit.
This commit is contained in:
Skoader
2012-11-12 03:28:53 +11:00
parent 2c06d3b2d3
commit 7a47e52ac6
4 changed files with 155 additions and 405 deletions

View File

@ -355,6 +355,7 @@ plSimulationMgr::plSimulationMgr()
, fMaxDelta(kDefaultMaxDelta)
, fStepSize(kDefaultStepSize)
, fAccumulator(0.0f)
, fStepCount(0)
, fLOSDispatch(TRACKED_NEW plLOSDispatch())
, fSoundMgr(new plPhysicsSoundMgr)
, fLog(nil)
@ -609,6 +610,8 @@ void plSimulationMgr::Advance(float delSecs)
fAccumulator = fMaxDelta;
}
++fStepCount;
// Perform as many whole substeps as possible saving the remainder in our accumulator.
int numSubSteps = (int)(fAccumulator / fStepSize + 0.000001f);
float delta = numSubSteps * fStepSize;