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

Method spawnExplosion

Engine/source/T3D/fx/splash.cpp:686–708  ·  view source on GitHub ↗

---------------------------------------------------------------------------- Explode ----------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

684// Explode
685//----------------------------------------------------------------------------
686void Splash::spawnExplosion()
687{
688 if( !mDataBlock->explosion ) return;
689
690 /// could just play the explosion one, but explosion could be weapon specific,
691 /// splash sound could be liquid specific. food for thought.
692 SFXProfile* sound_prof = mDataBlock->getSoundProfile();
693 if (sound_prof)
694 {
695 SFX->playOnce(sound_prof, &getTransform());
696 }
697
698 Explosion* pExplosion = new Explosion;
699 pExplosion->onNewDataBlock(mDataBlock->explosion, false);
700
701 MatrixF trans = getTransform();
702 trans.setPosition( getPosition() );
703
704 pExplosion->setTransform( trans );
705 pExplosion->setInitialState( trans.getPosition(), VectorF(0,0,1), 1);
706 if (!pExplosion->registerObject())
707 delete pExplosion;
708}
709
710//--------------------------------------------------------------------------
711// packUpdate

Callers

nothing calls this directly

Calls 8

getPositionFunction · 0.85
playOnceMethod · 0.45
onNewDataBlockMethod · 0.45
setPositionMethod · 0.45
setTransformMethod · 0.45
setInitialStateMethod · 0.45
getPositionMethod · 0.45
registerObjectMethod · 0.45

Tested by

no test coverage detected