MCPcopy Create free account
hub / github.com/OpenApoc/OpenApoc / facingDistance

Function facingDistance

game/state/city/vehicle.cpp:54–66  ·  view source on GitHub ↗

return the difference f1-f2 in the range [-pi;pi] a negative return value means f1 is CCW from f2.

Source from the content-addressed store, hash-verified

52// return the difference f1-f2 in the range [-pi;pi]
53// a negative return value means f1 is CCW from f2.
54float facingDistance(float f1, float f2)
55{
56 float result = f1 - f2;
57 while (result > M_PI)
58 {
59 result -= M_2xPI;
60 }
61 while (result <= -M_PI)
62 {
63 result += M_2xPI;
64 }
65 return result;
66}
67} // namespace
68
69template <> const UString &StateObject<Vehicle>::getPrefix()

Callers 2

updateMethod · 0.85
updateMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected