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

Function angle_difference_signed

ogsr_engine/xrCore/vector.h:142–156  ·  view source on GitHub ↗

-PI..PI

Source from the content-addressed store, hash-verified

140
141// -PI..PI
142ICF float angle_difference_signed(float a, float b)
143{
144 float diff = angle_normalize_signed(a) - angle_normalize_signed(b);
145 if (diff > 0)
146 {
147 if (diff > PI)
148 diff -= PI_MUL_2;
149 }
150 else
151 {
152 if (diff < -PI)
153 diff += PI_MUL_2;
154 }
155 return diff;
156}
157
158// 0..PI
159ICF float angle_difference(float a, float b) { return _abs(angle_difference_signed(a, b)); }

Callers 6

UpdateAfMethod · 0.85
cam_SetLadderMethod · 0.85
camUpdateLadderMethod · 0.85
angle_differenceFunction · 0.85
angle_inertionFunction · 0.85
angle_inertion_varFunction · 0.85

Calls 1

angle_normalize_signedFunction · 0.85

Tested by

no test coverage detected