MCPcopy Create free account
hub / github.com/BohemiaInteractive/CWR / VisibleMovement

Method VisibleMovement

engine/Poseidon/AI/VehicleAIPilot.cpp:2292–2306  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2290}
2291
2292float EntityAI::VisibleMovement() const
2293{
2294 float camouflage = GetType()->_camouflage;
2295 float vis = camouflage;
2296
2297 saturateMax(vis, _shootVisible); // firing target is better visible
2298 float rSpeed = fabs(ModelSpeed().Z()) * 3;
2299 if (rSpeed > vis * GetRadius())
2300 { // moving target is better visible
2301 float relSpeed = rSpeed / GetRadius();
2302 saturateMin(relSpeed, 8);
2303 saturateMax(vis, relSpeed * camouflage);
2304 }
2305 return vis;
2306}
2307
2308float EntityAI::VisibleLights() const
2309{

Callers 2

HowMuchInterestingFunction · 0.45
DrawTargetInfoMethod · 0.45

Calls 6

saturateMaxFunction · 0.85
fabsFunction · 0.85
saturateMinFunction · 0.85
GetTypeFunction · 0.50
GetRadiusFunction · 0.50
ZMethod · 0.45

Tested by

no test coverage detected