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

Function zFrag_ProjectileManager

src/SB/Game/zShrapnel.cpp:572–728  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

570}
571
572void zFrag_ProjectileManager(F32 dt)
573{
574 xVec3 tanVel;
575 xVec3 oldPos;
576 xMat3x3 spin;
577 xVec3 back;
578 xVec3 newAxis;
579 F32 percent;
580 xVec3 uVar1;
581
582 zFrag* frag = sProjectileList.next;
583
584 while (frag != NULL)
585 {
586 zFrag* next = frag->next;
587
588 frag->lifetime -= dt;
589 frag->alivetime += dt;
590
591 if (frag->lifetime < 0.0f)
592 {
593 zFrag_DeleteProjectile(frag);
594 }
595 else
596 {
597 frag->info.projectile.t = frag->info.projectile.t + dt;
598 S32 killed = FALSE;
599
600 if ((frag->info.projectile.fasset->flags & 1) != 0)
601 {
602 if (frag->info.projectile.t > frag->info.projectile.tColl)
603 {
604 frag->info.projectile.numBounces++;
605
606 if (frag->info.projectile.fasset->maxBounces >= 0 &&
607 frag->info.projectile.numBounces > frag->info.projectile.fasset->maxBounces)
608 {
609 xVec3Init(&frag->info.projectile.path.initVel, 0.0f, 0.0f, 0.0f);
610 zFrag_DeleteProjectile(frag);
611 killed = TRUE;
612 }
613 else
614 {
615 xParabolaRecenter(&frag->info.projectile.path, frag->info.projectile.tColl);
616
617 percent =
618 xVec3Dot(&frag->info.projectile.N, &frag->info.projectile.path.initVel);
619 xVec3AddScaled(&frag->info.projectile.path.initVel,
620 &frag->info.projectile.N,
621 -(1.0f + frag->info.projectile.fasset->bounce) * percent);
622 xVec3AddScaled(&frag->info.projectile.path.initPos,
623 &frag->info.projectile.path.initVel,
624 frag->info.projectile.t - frag->info.projectile.tColl);
625 frag->info.projectile.path.minTime = 0.0f;
626 frag->info.projectile.path.maxTime = frag->lifetime;
627
628 if ((frag->info.projectile.fasset->flags & 0x20) == 0)
629 {

Callers 1

zShrapnel_UpdateFunction · 0.70

Calls 15

zFrag_DeleteProjectileFunction · 0.85
xVec3InitFunction · 0.85
xParabolaRecenterFunction · 0.85
xVec3AddScaledFunction · 0.85
xVec3CrossFunction · 0.85
xVec3CopyFunction · 0.85
xVec3LengthFunction · 0.85
zFrag_ProjectileCollDataFunction · 0.85
xVec3SubFunction · 0.85
xVec3Length2Function · 0.85
xsqrtFunction · 0.85
xVec3SMulFunction · 0.85

Tested by

no test coverage detected