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

Method Pmove

qcommon/src/main/java/jake2/qcommon/PMove.java:1012–1126  ·  view source on GitHub ↗

Can be called by either the server or the client.

(pmove_t pmove)

Source from the content-addressed store, hash-verified

1010 * Can be called by either the server or the client.
1011 */
1012 public static void Pmove(pmove_t pmove) {
1013 pm = pmove;
1014
1015 // clear results
1016 pm.numtouch = 0;
1017 Math3D.VectorClear(pm.viewangles);
1018 pm.viewheight = 0;
1019 pm.groundentity = null;
1020 pm.watertype = 0;
1021 pm.waterlevel = 0;
1022
1023 pml.groundsurface = null;
1024 pml.groundcontents = 0;
1025
1026 // convert origin and velocity to float values
1027 pml.origin[0] = pm.s.origin[0] * 0.125f;
1028 pml.origin[1] = pm.s.origin[1] * 0.125f;
1029 pml.origin[2] = pm.s.origin[2] * 0.125f;
1030
1031 pml.velocity[0] = pm.s.velocity[0] * 0.125f;
1032 pml.velocity[1] = pm.s.velocity[1] * 0.125f;
1033 pml.velocity[2] = pm.s.velocity[2] * 0.125f;
1034
1035 // save old org in case we get stuck
1036 Math3D.VectorCopy(pm.s.origin, pml.previous_origin);
1037
1038 pml.frametime = (pm.cmd.msec & 0xFF) * 0.001f;
1039
1040 PM_ClampAngles();
1041
1042 if (pm.s.pm_type == Defines.PM_SPECTATOR) {
1043 PM_FlyMove(false);
1044 PM_SnapPosition();
1045 return;
1046 }
1047
1048 if (pm.s.pm_type >= Defines.PM_DEAD) {
1049 pm.cmd.forwardmove = 0;
1050 pm.cmd.sidemove = 0;
1051 pm.cmd.upmove = 0;
1052 }
1053
1054 if (pm.s.pm_type == Defines.PM_FREEZE)
1055 return; // no movement at all
1056
1057 // set mins, maxs, and viewheight
1058 PM_CheckDuck();
1059
1060 if (pm.snapinitial)
1061 PM_InitialSnapPosition();
1062
1063 // set groundentity, watertype, and waterlevel
1064 PM_CatagorizePosition();
1065
1066 if (pm.s.pm_type == Defines.PM_DEAD)
1067 PM_DeadMove();
1068
1069 PM_CheckSpecialMovement();

Callers 2

PredictMovementMethod · 0.95
PmoveMethod · 0.95

Calls 15

VectorClearMethod · 0.95
VectorCopyMethod · 0.95
PM_ClampAnglesMethod · 0.95
PM_FlyMoveMethod · 0.95
PM_SnapPositionMethod · 0.95
PM_CheckDuckMethod · 0.95
PM_CatagorizePositionMethod · 0.95
PM_DeadMoveMethod · 0.95
PM_StepSlideMoveMethod · 0.95
PM_CheckJumpMethod · 0.95

Tested by

no test coverage detected