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

Method explode

Engine/source/T3D/debris.cpp:896–914  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

894}
895
896void Debris::explode()
897{
898
899 if( !mDataBlock->explosion ) return;
900
901 Point3F explosionPos = getPosition();
902
903 Explosion* pExplosion = new Explosion;
904 pExplosion->setSubstitutionData(ss_object, ss_index);
905 pExplosion->onNewDataBlock(mDataBlock->explosion->cloneAndPerformSubstitutions(ss_object, ss_index), false);
906
907 MatrixF trans( true );
908 trans.setPosition( getPosition() );
909
910 pExplosion->setTransform( trans );
911 pExplosion->setInitialState( explosionPos, VectorF(0,0,1), 1);
912 if (!pExplosion->registerObject())
913 delete pExplosion;
914}
915
916void Debris::computeNewState( Point3F &newPos, Point3F &newVel, F32 dt )
917{

Callers

nothing calls this directly

Calls 8

getPositionFunction · 0.85
setSubstitutionDataMethod · 0.45
onNewDataBlockMethod · 0.45
setPositionMethod · 0.45
setTransformMethod · 0.45
setInitialStateMethod · 0.45
registerObjectMethod · 0.45

Tested by

no test coverage detected