MCPcopy Create free account
hub / github.com/bulletphysics/bullet3 / reset

Method reset

examples/Utils/b3Clock.cpp:82–113  ·  view source on GitHub ↗

Resets the initial reference time.

Source from the content-addressed store, hash-verified

80
81/// Resets the initial reference time.
82void b3Clock::reset(bool zeroReference)
83{
84 if (zeroReference)
85 {
86#ifdef B3_USE_WINDOWS_TIMERS
87 m_data->mStartTime.QuadPart = 0;
88#else
89#ifdef __CELLOS_LV2__
90 m_data->mStartTime = 0;
91#else
92 m_data->mStartTime = (struct timeval){0};
93#endif
94#endif
95 }
96 else
97 {
98#ifdef B3_USE_WINDOWS_TIMERS
99 QueryPerformanceCounter(&m_data->mStartTime);
100#else
101#ifdef __CELLOS_LV2__
102
103 typedef uint64_t ClockSize;
104 ClockSize newTime;
105 //__asm __volatile__( "mftb %0" : "=r" (newTime) : : "memory");
106 SYS_TIMEBASE_GET(newTime);
107 m_data->mStartTime = newTime;
108#else
109 gettimeofday(&m_data->mStartTime, 0);
110#endif
111#endif
112 }
113}
114
115/// Returns the time in ms since the last call to reset or since
116/// the b3Clock was created.

Callers 15

ResetMethod · 0.45
rendermeMethod · 0.45
ExampleBrowserThreadFuncFunction · 0.45
mainFunction · 0.45
castMethod · 0.45
initPhysicsMethod · 0.45
processCollisionMethod · 0.45
glueCallbackMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected