| 416 | } |
| 417 | |
| 418 | bool ExplosionData::onAdd() |
| 419 | { |
| 420 | if (Parent::onAdd() == false) |
| 421 | return false; |
| 422 | |
| 423 | if (explosionScale.x < 0.01f || explosionScale.y < 0.01f || explosionScale.z < 0.01f) |
| 424 | { |
| 425 | Con::warnf(ConsoleLogEntry::General, "ExplosionData(%s)::onAdd: ExplosionScale components must be >= 0.01", getName()); |
| 426 | explosionScale.x = explosionScale.x < 0.01f ? 0.01f : explosionScale.x; |
| 427 | explosionScale.y = explosionScale.y < 0.01f ? 0.01f : explosionScale.y; |
| 428 | explosionScale.z = explosionScale.z < 0.01f ? 0.01f : explosionScale.z; |
| 429 | } |
| 430 | |
| 431 | if (debrisThetaMin < 0.0f) |
| 432 | { |
| 433 | Con::warnf(ConsoleLogEntry::General, "ExplosionData(%s) debrisThetaMin < 0.0", getName()); |
| 434 | debrisThetaMin = 0.0f; |
| 435 | } |
| 436 | if (debrisThetaMax > 180.0f) |
| 437 | { |
| 438 | Con::warnf(ConsoleLogEntry::General, "ExplosionData(%s) debrisThetaMax > 180.0", getName()); |
| 439 | debrisThetaMax = 180.0f; |
| 440 | } |
| 441 | if (debrisThetaMin > debrisThetaMax) { |
| 442 | Con::warnf(ConsoleLogEntry::General, "ExplosionData(%s) debrisThetaMin > debrisThetaMax", getName()); |
| 443 | debrisThetaMin = debrisThetaMax; |
| 444 | } |
| 445 | if (debrisPhiMin < 0.0f) |
| 446 | { |
| 447 | Con::warnf(ConsoleLogEntry::General, "ExplosionData(%s) debrisPhiMin < 0.0", getName()); |
| 448 | debrisPhiMin = 0.0f; |
| 449 | } |
| 450 | if (debrisPhiMax > 360.0f) |
| 451 | { |
| 452 | Con::warnf(ConsoleLogEntry::General, "ExplosionData(%s) debrisPhiMax > 360.0", getName()); |
| 453 | debrisPhiMax = 360.0f; |
| 454 | } |
| 455 | if (debrisPhiMin > debrisPhiMax) { |
| 456 | Con::warnf(ConsoleLogEntry::General, "ExplosionData(%s) debrisPhiMin > debrisPhiMax", getName()); |
| 457 | debrisPhiMin = debrisPhiMax; |
| 458 | } |
| 459 | if (debrisNum > 1000) { |
| 460 | Con::warnf(ConsoleLogEntry::General, "ExplosionData(%s) debrisNum > 1000", getName()); |
| 461 | debrisNum = 1000; |
| 462 | } |
| 463 | if (debrisNumVariance > 1000) { |
| 464 | Con::warnf(ConsoleLogEntry::General, "ExplosionData(%s) debrisNumVariance > 1000", getName()); |
| 465 | debrisNumVariance = 1000; |
| 466 | } |
| 467 | if (debrisVelocity < 0.1f) |
| 468 | { |
| 469 | Con::warnf(ConsoleLogEntry::General, "ExplosionData(%s) debrisVelocity < 0.1", getName()); |
| 470 | debrisVelocity = 0.1f; |
| 471 | } |
| 472 | if (debrisVelocityVariance > 1000) { |
| 473 | Con::warnf(ConsoleLogEntry::General, "ExplosionData(%s) debrisVelocityVariance > 1000", getName()); |
| 474 | debrisVelocityVariance = 1000; |
| 475 | } |
nothing calls this directly
no test coverage detected