| 629 | |
| 630 | |
| 631 | void Player::updateTranslucency(float dt) { |
| 632 | // update the alpha value |
| 633 | if (alphaRate != 0.0f) { |
| 634 | alpha += dt * alphaRate; |
| 635 | if (alphaRate < 0.0f) { |
| 636 | if (alpha < alphaTarget) { |
| 637 | alpha = alphaTarget; |
| 638 | alphaRate = 0.0f; |
| 639 | } |
| 640 | } |
| 641 | else { |
| 642 | if (alpha > alphaTarget) { |
| 643 | alpha = alphaTarget; |
| 644 | alphaRate = 0.0f; |
| 645 | } |
| 646 | } |
| 647 | } |
| 648 | |
| 649 | // set the tankNode color |
| 650 | if (isPhantomZoned()) { |
| 651 | teleAlpha = 1.0f; |
| 652 | color.a = 0.25f; // barely visible, regardless of teleporter proximity |
| 653 | } |
| 654 | else { |
| 655 | World* world = World::getWorld(); |
| 656 | if (!world) { |
| 657 | return; |
| 658 | } |
| 659 | teleporterProximity = world->getProximity(state.pos, BZDBCache::tankRadius); |
| 660 | teleAlpha = (1.0f - (0.75f * teleporterProximity)); |
| 661 | |
| 662 | if (alpha == 0.0f) { |
| 663 | color.a = 0.0f; // not trusting FP accuracy |
| 664 | } |
| 665 | else { |
| 666 | color.a = teleAlpha * alpha; |
| 667 | } |
| 668 | } |
| 669 | } |
| 670 | |
| 671 | |
| 672 | void Player::updateTreads(float dt) { |
nothing calls this directly
no test coverage detected