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

Method VisualUpdate

ogsr_engine/xrGame/Car.cpp:486–516  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

484}
485
486void CCar::VisualUpdate(float fov)
487{
488 m_pPhysicsShell->InterpolateGlobalTransform(&XFORM());
489
490 Fvector lin_vel;
491 m_pPhysicsShell->get_LinearVel(lin_vel);
492 // Sound
493 Fvector C, V;
494 Center(C);
495 V.set(lin_vel);
496
497 m_car_sound->Update();
498 if (Owner())
499 {
500 if (m_pPhysicsShell->isEnabled())
501 {
502 Owner()->XFORM().mul_43(XFORM(), m_sits_transforms);
503 }
504
505 if (HUD().GetUI()) //
506 {
507 HUD().GetUI()->UIMainIngameWnd->CarPanel().Show(true);
508 HUD().GetUI()->UIMainIngameWnd->CarPanel().SetCarHealth(GetfHealth() /* /100.f*/);
509 HUD().GetUI()->UIMainIngameWnd->CarPanel().SetSpeed(lin_vel.magnitude() / 1000.f * 3600.f / 100.f);
510 HUD().GetUI()->UIMainIngameWnd->CarPanel().SetRPM(m_current_rpm / m_max_rpm / 2.f);
511 }
512 }
513
514 UpdateExhausts();
515 m_lights.Update();
516}
517
518void CCar::renderable_Render(u32 context_id, IRenderable* root)
519{

Callers

nothing calls this directly

Calls 15

XFORMFunction · 0.85
GetfHealthFunction · 0.85
mul_43Method · 0.80
GetUIMethod · 0.80
SetCarHealthMethod · 0.80
SetRPMMethod · 0.80
OwnerFunction · 0.70
get_LinearVelMethod · 0.45
setMethod · 0.45
UpdateMethod · 0.45
isEnabledMethod · 0.45

Tested by

no test coverage detected