MCPcopy Create free account
hub / github.com/NVIDIAGameWorks/PhysX / update

Method update

physx/samples/pxtoolkit/src/PxTkFPS.cpp:46–69  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

44}
45
46void FPS::update()
47{
48 // Keep track of the time lapse and frame count
49 mFrames++;
50 mFrames2++;
51
52 // Instant frame rate
53 PxReal Delta = PxReal(mTimer2.peekElapsedSeconds());
54 if(Delta > 0.01f)
55 {
56 mInstantFPS = PxReal(mFrames2) / Delta;
57 mTimer2.getElapsedSeconds();
58 mFrames2 = 0;
59 }
60
61 // Update the frame rate once per second
62 Delta = PxReal(mTimer.peekElapsedSeconds());
63 if(Delta > 1.0f)
64 {
65 mFPS = PxReal(mFrames) / Delta;
66 mTimer.getElapsedSeconds();
67 mFrames = 0;
68 }
69}

Callers

nothing calls this directly

Calls 2

peekElapsedSecondsMethod · 0.45
getElapsedSecondsMethod · 0.45

Tested by

no test coverage detected