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

Method UpdateBack

ogsr_engine/xrGame/Car.cpp:1377–1406  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1375float CCar::AntiGravityAccel() { return ph_world->Gravity() - EffectiveGravity(); }
1376float CCar::GravityFactorImpulse() { return _sqrt(EffectiveGravity() / ph_world->Gravity()); }
1377void CCar::UpdateBack()
1378{
1379 if (b_breaks)
1380 {
1381 float k = 1.f;
1382 float time = (Device.fTimeGlobal - m_break_start);
1383 if (time < m_break_time)
1384 {
1385 k *= (time / m_break_time);
1386 }
1387 xr_vector<SWheelBreak>::iterator i, e;
1388 i = m_breaking_wheels.begin();
1389 e = m_breaking_wheels.end();
1390 for (; i != e; ++i)
1391 i->Break(k);
1392 Fvector v;
1393 m_pPhysicsShell->get_LinearVel(v);
1394 // if(DriveWheelsMeanAngleRate()<m_breaks_to_back_rate)
1395 if (v.dotproduct(XFORM().k) < EPS)
1396 {
1397 StopBreaking();
1398 DriveBack();
1399 }
1400 }
1401 // else
1402 //{
1403 // UpdatePower();
1404 // if(b_engine_on&&!b_starting && m_current_rpm<m_min_rpm)Stall();
1405 // }
1406}
1407
1408void CCar::PlayExhausts()
1409{

Callers

nothing calls this directly

Calls 6

XFORMFunction · 0.85
beginMethod · 0.45
endMethod · 0.45
BreakMethod · 0.45
get_LinearVelMethod · 0.45
dotproductMethod · 0.45

Tested by

no test coverage detected