| 4244 | } |
| 4245 | |
| 4246 | void zEntPlayer_PredictPos(xVec3* pos, F32 timeIntoFuture, F32 leadFactor, S32 useTurn) |
| 4247 | { |
| 4248 | zPlayerGlobals* g = &globals.player; |
| 4249 | F32 useVel; |
| 4250 | F32 useAngV; |
| 4251 | xMat3x3 rotMat; |
| 4252 | |
| 4253 | useVel = g->PredictCurrVel * leadFactor; |
| 4254 | useAngV = g->PredictAngV; |
| 4255 | |
| 4256 | if ((useTurn != 0) && (useAngV > 0.05f || useAngV < -0.05f)) |
| 4257 | { |
| 4258 | xMat3x3RotY(&rotMat, leadFactor * (timeIntoFuture * useAngV)); |
| 4259 | xMat3x3RMulVec(pos, &rotMat, &g->PredictRotate); |
| 4260 | xVec3AddTo(pos, &g->PredictTranslate); |
| 4261 | } |
| 4262 | else |
| 4263 | { |
| 4264 | xVec3Copy(pos, (xVec3*)&g->ent.model->Mat->pos); |
| 4265 | if (useVel > 0.05f) |
| 4266 | { |
| 4267 | xVec3AddScaled(pos, &g->PredictCurrDir, (timeIntoFuture * useVel)); |
| 4268 | } |
| 4269 | } |
| 4270 | } |
| 4271 | |
| 4272 | static S32 zEntPlayerKnockToSafety(xEnt* ent) |
| 4273 | { |
no test coverage detected