MCPcopy Create free account
hub / github.com/NVIDIAGameWorks/Blast / simulationBegin

Method simulationBegin

samples/SampleBase/physx/PhysXController.cpp:267–303  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

265///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
266
267void PhysXController::simulationBegin(float dt)
268{
269 PROFILER_SCOPED_FUNCTION();
270
271 if (m_paused)
272 return;
273
274 updateDragging(dt);
275 processExplosionQueue();
276
277 // slower physics if fps is too low
278 dt = PxClamp(dt, 0.0f, 0.0333f);
279
280 {
281 PROFILER_SCOPED("PhysX simulate call");
282 if (m_useFixedTimeStep)
283 {
284 m_timeAccumulator += dt;
285 m_substepCount = (uint32_t)std::floor(m_timeAccumulator / m_fixedTimeStep);
286 m_timeAccumulator -= m_fixedTimeStep * m_substepCount;
287 m_substepCount = m_maxSubstepCount > 0 ? physx::PxClamp<uint32_t>(m_substepCount, 0, m_maxSubstepCount) : m_substepCount;
288 if (m_substepCount > 0)
289 {
290 m_physicsScene->simulate(m_fixedTimeStep);
291 m_isSimulating = true;
292 }
293 }
294 else
295 {
296 m_substepCount = 1;
297 PX_ASSERT(!m_isSimulating);
298 m_physicsScene->simulate(dt);
299 m_isSimulating = true;
300
301 }
302 }
303}
304
305void PhysXController::simualtionSyncEnd()
306{

Callers 1

AnimateMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected