MCPcopy Create free account
hub / github.com/OGSR/OGSR-Engine / FrameStep

Method FrameStep

ogsr_engine/xrGame/PHWorld.cpp:343–392  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

341};
342
343void CPHWorld::FrameStep(dReal step)
344{
345 if (IsFreezed())
346 return;
347
348 VERIFY(_valid(step));
349 step *= phTimefactor;
350 // compute contact joints and forces
351
352 // step+=astep;
353
354 // const dReal k_p=24000000.f;//550000.f;///1000000.f;
355 // const dReal k_d=400000.f;
356 u32 it_number;
357 float frame_time = m_frame_time;
358 frame_time += step;
359 // m_frame_sum+=step;
360#ifdef DEBUG
361 if (ph_dbg_draw_mask.test(phDbgDrawObjectStatistics))
362 {
363 static float dbg_iterations = 0.f;
364 dbg_iterations = dbg_iterations * 0.9f + step / fixed_step * 0.1f;
365 b_processing = true;
366 DBG_OutText("phys steps per frame %2.1f", dbg_iterations);
367 b_processing = false;
368 }
369#endif
370 if (!(frame_time < fixed_step))
371 {
372 it_number = iFloor(frame_time / fixed_step);
373 frame_time -= it_number * fixed_step;
374 m_previous_frame_time = m_frame_time;
375 m_frame_time = frame_time;
376 b_frame_mark = !b_frame_mark;
377 }
378 else
379 {
380 m_frame_time = frame_time;
381 return;
382 }
383 // for(UINT i=0;i<(m_reduce_delay+1);++i)
384 b_processing = true;
385
386 start_time = Device.dwTimeGlobal; // - u32(m_frame_time*1000);
387 if (g_bDebugDumpPhysicsStep && it_number > 20)
388 Msg("!!!TOO MANY PHYSICS STEPS PER FRAME = %d !!!", it_number);
389 for (UINT i = 0; i < it_number; ++i)
390 Step();
391 b_processing = false;
392}
393
394void CPHWorld::AddObject(CPHObject* object)
395{

Callers

nothing calls this directly

Calls 4

DBG_OutTextFunction · 0.85
MsgFunction · 0.85
_validFunction · 0.50
testMethod · 0.45

Tested by

no test coverage detected