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

Function OperHeuristic

engine/Poseidon/Game/OperMap.cpp:457–466  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

455#endif
456
457inline float OperHeuristic(float dx, float dz)
458{
459 dx = fabs(dx);
460 dz = fabs(dz);
461 float sum = dx + dz;
462 float adif = fabs(dx - dz);
463 float minD2 = (sum - adif);
464 float maxD2 = (sum + adif);
465 return (maxD2 - minD2) * 0.5 + (H_SQRT2 * 0.5) * minD2;
466}
467
468int AI::CalcDirection(Vector3 direction)
469{

Callers 1

FindPathMethod · 0.85

Calls 1

fabsFunction · 0.85

Tested by

no test coverage detected