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

Method onAdd

Engine/source/T3D/fx/explosion.cpp:541–661  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

539}
540
541bool 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 }

Callers

nothing calls this directly

Calls 15

mFabsFunction · 0.85
createOrientFromDirFunction · 0.85
getPositionFunction · 0.85
randFMethod · 0.80
mulVMethod · 0.80
setFrequencyMethod · 0.80
setAmplitudeMethod · 0.80
setFalloffMethod · 0.80
addFXMethod · 0.80
addObjectToSceneMethod · 0.80
randIMethod · 0.60
warnfFunction · 0.50

Tested by

no test coverage detected