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

Function BbowlCB

src/SB/Game/zEntPlayer.cpp:1742–1770  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1740}
1741
1742static U32 BbowlCB(xAnimTransition* tran, xAnimSingle* anim, void* param_3)
1743{
1744 zEntPlayer_SNDPlay(ePlayerSnd_BowlWindup, 0.0f);
1745 zEntPlayer_SNDStop(ePlayerSnd_SlipLoop);
1746
1747 xEntFrame* frame = globals.player.ent.frame;
1748 F32 x = (frame->mat.pos.x - frame->oldmat.pos.x) * last_update_dt;
1749 F32 z = (frame->mat.pos.z - frame->oldmat.pos.z) * last_update_dt;
1750 F32 speed2 = x * x + z * z;
1751
1752 if (speed2 < globals.player.g.BubbleBowlMinSpeed * globals.player.g.BubbleBowlMinSpeed)
1753 {
1754 globals.player.bbowlInitVel = globals.player.g.BubbleBowlMinSpeed;
1755 }
1756 else
1757 {
1758 globals.player.bbowlInitVel = xsqrt(speed2);
1759 }
1760
1761 frame->vel.x = globals.player.bbowlInitVel * globals.player.ent.model->Mat->at.x;
1762 frame->vel.z = globals.player.bbowlInitVel * globals.player.ent.model->Mat->at.z;
1763
1764 sShouldBubbleBowl = 0;
1765 globals.player.IsBubbleBowling = 1;
1766 sBubbleBowlTimer = 0.0f;
1767 sBubbleBowlLastWindupTime = -1.0f;
1768
1769 return 0;
1770}
1771
1772static U32 BbowlWindupEndCheck(xAnimTransition* tran, xAnimSingle* anim, void* param_3)
1773{

Callers

nothing calls this directly

Calls 3

zEntPlayer_SNDPlayFunction · 0.85
zEntPlayer_SNDStopFunction · 0.85
xsqrtFunction · 0.85

Tested by

no test coverage detected