| 4216 | } |
| 4217 | |
| 4218 | static void zEntPlayer_PredictionUpdate(xEnt* ent, F32 dt) |
| 4219 | { |
| 4220 | zPlayerGlobals* g = &globals.player; |
| 4221 | F32 lastVel; |
| 4222 | F32 newAngV; |
| 4223 | F32 r; |
| 4224 | |
| 4225 | xVec3Copy((xVec3*)&newAngV, &g->PredictCurrDir); // newangv prolly not right |
| 4226 | xVec3Sub(&g->PredictCurrDir, &ent->frame->mat.pos, &ent->frame->oldmat.pos); |
| 4227 | xVec3SMulBy(&g->PredictCurrDir, (1.0f / last_update_dt)); |
| 4228 | r = xVec3Length(&g->PredictCurrDir); |
| 4229 | g->PredictCurrVel = r; |
| 4230 | |
| 4231 | if (r > 0.05f) |
| 4232 | { |
| 4233 | xVec3SMulBy(&g->PredictCurrDir, 1.0f); |
| 4234 | } |
| 4235 | else |
| 4236 | { |
| 4237 | xVec3Copy(&g->PredictCurrDir, &ent->frame->mat.pos); |
| 4238 | } |
| 4239 | |
| 4240 | if (g->PredictCurrDir.x > 0.05f) |
| 4241 | { |
| 4242 | // xVec3Cross(&g->PredictCurrDir, const xVec3*, const xVec3*) local vars |
| 4243 | } |
| 4244 | } |
| 4245 | |
| 4246 | void zEntPlayer_PredictPos(xVec3* pos, F32 timeIntoFuture, F32 leadFactor, S32 useTurn) |
| 4247 | { |
no test coverage detected