----------------------------------------------------------------------------- onAdd -----------------------------------------------------------------------------
| 516 | // onAdd |
| 517 | //----------------------------------------------------------------------------- |
| 518 | bool ParticleEmitterData::onAdd() |
| 519 | { |
| 520 | if( Parent::onAdd() == false ) |
| 521 | return false; |
| 522 | |
| 523 | // if (overrideAdvance == true) { |
| 524 | // Con::errorf(ConsoleLogEntry::General, "ParticleEmitterData: Not going to work. Fix it!"); |
| 525 | // return false; |
| 526 | // } |
| 527 | |
| 528 | // Validate the parameters... |
| 529 | // |
| 530 | if( ejectionPeriodMS < 1 ) |
| 531 | { |
| 532 | Con::warnf(ConsoleLogEntry::General, "ParticleEmitterData(%s) period < 1 ms", getName()); |
| 533 | ejectionPeriodMS = 1; |
| 534 | } |
| 535 | if( periodVarianceMS >= ejectionPeriodMS ) |
| 536 | { |
| 537 | Con::warnf(ConsoleLogEntry::General, "ParticleEmitterData(%s) periodVariance >= period", getName()); |
| 538 | periodVarianceMS = ejectionPeriodMS - 1; |
| 539 | } |
| 540 | if( ejectionVelocity < 0.0f ) |
| 541 | { |
| 542 | Con::warnf(ConsoleLogEntry::General, "ParticleEmitterData(%s) ejectionVelocity < 0.0f", getName()); |
| 543 | ejectionVelocity = 0.0f; |
| 544 | } |
| 545 | if( velocityVariance < 0.0f ) |
| 546 | { |
| 547 | Con::warnf(ConsoleLogEntry::General, "ParticleEmitterData(%s) velocityVariance < 0.0f", getName()); |
| 548 | velocityVariance = 0.0f; |
| 549 | } |
| 550 | if( velocityVariance > ejectionVelocity ) |
| 551 | { |
| 552 | Con::warnf(ConsoleLogEntry::General, "ParticleEmitterData(%s) velocityVariance > ejectionVelocity", getName()); |
| 553 | velocityVariance = ejectionVelocity; |
| 554 | } |
| 555 | if( ejectionOffset < 0.0f ) |
| 556 | { |
| 557 | Con::warnf(ConsoleLogEntry::General, "ParticleEmitterData(%s) ejectionOffset < 0", getName()); |
| 558 | ejectionOffset = 0.0f; |
| 559 | } |
| 560 | if( ejectionOffsetVariance < 0.0f ) |
| 561 | { |
| 562 | Con::warnf(ConsoleLogEntry::General, "ParticleEmitterData(%s) ejectionOffset < 0", getName()); |
| 563 | ejectionOffsetVariance = 0.0f; |
| 564 | } |
| 565 | if( thetaMin < 0.0f ) |
| 566 | { |
| 567 | Con::warnf(ConsoleLogEntry::General, "ParticleEmitterData(%s) thetaMin < 0.0", getName()); |
| 568 | thetaMin = 0.0f; |
| 569 | } |
| 570 | if( thetaMax > 180.0f ) |
| 571 | { |
| 572 | Con::warnf(ConsoleLogEntry::General, "ParticleEmitterData(%s) thetaMax > 180.0", getName()); |
| 573 | thetaMax = 180.0f; |
| 574 | } |
| 575 | if( thetaMin > thetaMax ) |
nothing calls this directly
no test coverage detected