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

Function zEntPlayer_PredictPos

src/SB/Game/zEntPlayer.cpp:4246–4270  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4244}
4245
4246void 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
4272static S32 zEntPlayerKnockToSafety(xEnt* ent)
4273{

Callers 7

CheckSpotMethod · 0.70
FlankPlayerMethod · 0.70
SonarHomingMethod · 0.70
CirclePlayerMethod · 0.70
PlayerInSpotMethod · 0.70
CacheAimPointMethod · 0.70
ProcessMethod · 0.70

Calls 5

xMat3x3RotYFunction · 0.85
xVec3AddToFunction · 0.85
xVec3CopyFunction · 0.85
xVec3AddScaledFunction · 0.85
xMat3x3RMulVecFunction · 0.50

Tested by

no test coverage detected