MCPcopy Create free account
hub / github.com/demoth/jake2 / ClampPitch

Method ClampPitch

client/src/main/java/jake2/client/CL_input.java:278–295  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

276 }
277
278 private static void ClampPitch() {
279
280 float pitch;
281
282 pitch = Math3D.SHORT2ANGLE(ClientGlobals.cl.frame.playerstate.pmove.delta_angles[Defines.PITCH]);
283 if (pitch > 180)
284 pitch -= 360;
285
286 if (ClientGlobals.cl.viewangles[Defines.PITCH] + pitch < -360)
287 ClientGlobals.cl.viewangles[Defines.PITCH] += 360; // wrapped
288 if (ClientGlobals.cl.viewangles[Defines.PITCH] + pitch > 360)
289 ClientGlobals.cl.viewangles[Defines.PITCH] -= 360; // wrapped
290
291 if (ClientGlobals.cl.viewangles[Defines.PITCH] + pitch > 89)
292 ClientGlobals.cl.viewangles[Defines.PITCH] = 89 - pitch;
293 if (ClientGlobals.cl.viewangles[Defines.PITCH] + pitch < -89)
294 ClientGlobals.cl.viewangles[Defines.PITCH] = -89 - pitch;
295 }
296
297 /*
298 * ============== CL_FinishMove ==============

Callers 1

FinishMoveMethod · 0.95

Calls 1

SHORT2ANGLEMethod · 0.95

Tested by

no test coverage detected