MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / onAdd

Method onAdd

Engine/source/T3D/fx/particleEmitter.cpp:518–694  ·  view source on GitHub ↗

----------------------------------------------------------------------------- onAdd -----------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

516// onAdd
517//-----------------------------------------------------------------------------
518bool 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 )

Callers

nothing calls this directly

Calls 14

dStrcpyFunction · 0.85
dStrtokFunction · 0.85
addParticleEmitterMethod · 0.80
getIdMethod · 0.65
warnfFunction · 0.50
getNameFunction · 0.50
dStrlenFunction · 0.50
errorfFunction · 0.50
findObjectFunction · 0.50
Point3FClass · 0.50
sizeMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected