| 570 | } |
| 571 | |
| 572 | void 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 | { |
no test coverage detected