mirror of
https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git
synced 2025-07-20 04:09:16 +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:
@ -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;
|
||||
|
@ -99,6 +99,8 @@ public:
|
||||
|
||||
int GetMaterialIdx(NxScene* scene, hsScalar friction, hsScalar restitution);
|
||||
|
||||
UInt32 GetStepCount() { return fStepCount; }
|
||||
|
||||
// PHYSX FIXME - walk thru all the convex hull detector regions to see if we are in any... we're either coming or going
|
||||
void UpdateDetectorsInScene(plKey world, plKey avatar, hsPoint3& pos, bool entering);
|
||||
void UpdateAvatarInDetector(plKey world, plPXPhysical* detector);
|
||||
@ -161,6 +163,8 @@ protected:
|
||||
float fStepSize;
|
||||
float fAccumulator;
|
||||
|
||||
UInt32 fStepCount;
|
||||
|
||||
// A utility class to keep track of a request for a physical synchronization.
|
||||
// These requests must pass a certain criteria (see the code for the latest)
|
||||
// before they are actually either sent over the network or rejected.
|
||||
|
Reference in New Issue
Block a user