()
| 205 | * Sets cl.predicted_origin and cl.predicted_angles ================= |
| 206 | */ |
| 207 | static void PredictMovement() { |
| 208 | |
| 209 | if (ClientGlobals.cls.state != Defines.ca_active) |
| 210 | return; |
| 211 | |
| 212 | if (ClientGlobals.cl_paused.value != 0.0f) |
| 213 | return; |
| 214 | |
| 215 | if (ClientGlobals.cl_predict.value == 0.0f |
| 216 | || (ClientGlobals.cl.frame.playerstate.pmove.pm_flags & Defines.PMF_NO_PREDICTION) != 0) { |
| 217 | // just set angles |
| 218 | for (int i = 0; i < 3; i++) { |
| 219 | ClientGlobals.cl.predicted_angles[i] = ClientGlobals.cl.viewangles[i] |
| 220 | + Math3D |
| 221 | .SHORT2ANGLE(ClientGlobals.cl.frame.playerstate.pmove.delta_angles[i]); |
| 222 | } |
| 223 | return; |
| 224 | } |
| 225 | |
| 226 | int ack = ClientGlobals.cls.netchan.incoming_acknowledged; |
| 227 | int current = ClientGlobals.cls.netchan.outgoing_sequence; |
| 228 | |
| 229 | // if we are too far out of date, just freeze |
| 230 | if (current - ack >= Defines.CMD_BACKUP) { |
| 231 | if (ClientGlobals.cl_showmiss.value != 0.0f) |
| 232 | Com.Printf("exceeded CMD_BACKUP\n"); |
| 233 | return; |
| 234 | } |
| 235 | |
| 236 | // copy current state to pmove |
| 237 | //memset (pm, 0, sizeof(pm)); |
| 238 | pmove_t pm = new pmove_t(); |
| 239 | |
| 240 | pm.trace = new pmove_t.TraceAdapter() { |
| 241 | public trace_t trace(float[] start, float[] mins, float[] maxs, |
| 242 | float[] end) { |
| 243 | return PMTrace(start, mins, maxs, end); |
| 244 | } |
| 245 | }; |
| 246 | pm.pointcontents = CL_pred::PMpointcontents; |
| 247 | |
| 248 | PMove.pm_airaccelerate = Lib.atof(ClientGlobals.cl.configstrings[Defines.CS_AIRACCEL]); |
| 249 | |
| 250 | // bugfix (rst) yeah !!!!!!!! found the solution to the B E W E G U N G |
| 251 | // S P R O B L E M. |
| 252 | pm.s.set(ClientGlobals.cl.frame.playerstate.pmove); |
| 253 | |
| 254 | // SCR_DebugGraph (current - ack - 1, 0); |
| 255 | int frame = 0; |
| 256 | |
| 257 | // run frames |
| 258 | usercmd_t cmd; |
| 259 | while (++ack < current) { |
| 260 | frame = ack & (Defines.CMD_BACKUP - 1); |
| 261 | cmd = ClientGlobals.cl.cmds[frame]; |
| 262 | |
| 263 | pm.cmd.set(cmd); |
| 264 |
no test coverage detected