| 539 | } |
| 540 | |
| 541 | bool ExplosionData::onAdd() |
| 542 | { |
| 543 | if (Parent::onAdd() == false) |
| 544 | return false; |
| 545 | |
| 546 | if (explosionScale.x < 0.01f || explosionScale.y < 0.01f || explosionScale.z < 0.01f) |
| 547 | { |
| 548 | Con::warnf(ConsoleLogEntry::General, "ExplosionData(%s)::onAdd: ExplosionScale components must be >= 0.01", getName()); |
| 549 | explosionScale.x = explosionScale.x < 0.01f ? 0.01f : explosionScale.x; |
| 550 | explosionScale.y = explosionScale.y < 0.01f ? 0.01f : explosionScale.y; |
| 551 | explosionScale.z = explosionScale.z < 0.01f ? 0.01f : explosionScale.z; |
| 552 | } |
| 553 | |
| 554 | if (debrisThetaMin < 0.0f) |
| 555 | { |
| 556 | Con::warnf(ConsoleLogEntry::General, "ExplosionData(%s) debrisThetaMin < 0.0", getName()); |
| 557 | debrisThetaMin = 0.0f; |
| 558 | } |
| 559 | if (debrisThetaMax > 180.0f) |
| 560 | { |
| 561 | Con::warnf(ConsoleLogEntry::General, "ExplosionData(%s) debrisThetaMax > 180.0", getName()); |
| 562 | debrisThetaMax = 180.0f; |
| 563 | } |
| 564 | if (debrisThetaMin > debrisThetaMax) { |
| 565 | Con::warnf(ConsoleLogEntry::General, "ExplosionData(%s) debrisThetaMin > debrisThetaMax", getName()); |
| 566 | debrisThetaMin = debrisThetaMax; |
| 567 | } |
| 568 | if (debrisPhiMin < 0.0f) |
| 569 | { |
| 570 | Con::warnf(ConsoleLogEntry::General, "ExplosionData(%s) debrisPhiMin < 0.0", getName()); |
| 571 | debrisPhiMin = 0.0f; |
| 572 | } |
| 573 | if (debrisPhiMax > 360.0f) |
| 574 | { |
| 575 | Con::warnf(ConsoleLogEntry::General, "ExplosionData(%s) debrisPhiMax > 360.0", getName()); |
| 576 | debrisPhiMax = 360.0f; |
| 577 | } |
| 578 | if (debrisPhiMin > debrisPhiMax) { |
| 579 | Con::warnf(ConsoleLogEntry::General, "ExplosionData(%s) debrisPhiMin > debrisPhiMax", getName()); |
| 580 | debrisPhiMin = debrisPhiMax; |
| 581 | } |
| 582 | if (debrisNum > 1000) { |
| 583 | Con::warnf(ConsoleLogEntry::General, "ExplosionData(%s) debrisNum > 1000", getName()); |
| 584 | debrisNum = 1000; |
| 585 | } |
| 586 | if (debrisNumVariance > 1000) { |
| 587 | Con::warnf(ConsoleLogEntry::General, "ExplosionData(%s) debrisNumVariance > 1000", getName()); |
| 588 | debrisNumVariance = 1000; |
| 589 | } |
| 590 | if (debrisVelocity < 0.1f) |
| 591 | { |
| 592 | Con::warnf(ConsoleLogEntry::General, "ExplosionData(%s) debrisVelocity < 0.1", getName()); |
| 593 | debrisVelocity = 0.1f; |
| 594 | } |
| 595 | if (debrisVelocityVariance > 1000) { |
| 596 | Con::warnf(ConsoleLogEntry::General, "ExplosionData(%s) debrisVelocityVariance > 1000", getName()); |
| 597 | debrisVelocityVariance = 1000; |
| 598 | } |
nothing calls this directly
no test coverage detected