MCPcopy Create free account
hub / github.com/bfbbdecomp/bfbb / zEntPlayer_PredictionUpdate

Function zEntPlayer_PredictionUpdate

src/SB/Game/zEntPlayer.cpp:4218–4244  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4216}
4217
4218static 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
4246void zEntPlayer_PredictPos(xVec3* pos, F32 timeIntoFuture, F32 leadFactor, S32 useTurn)
4247{

Callers 1

Calls 4

xVec3CopyFunction · 0.85
xVec3SubFunction · 0.85
xVec3SMulByFunction · 0.85
xVec3LengthFunction · 0.85

Tested by

no test coverage detected