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

Method restore

Engine/source/T3D/physics/physicsShape.cpp:1147–1167  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1145}
1146
1147void PhysicsShape::restore()
1148{
1149 if ( !mDestroyed )
1150 return;
1151
1152 PhysicsShapeData *db = getDataBlock();
1153 const bool isDynamic = db && db->mass > 0.0f;
1154
1155 if ( mDestroyedShape )
1156 mDestroyedShape->deleteObject();
1157
1158 // Restore tick processing, add it back to
1159 // the scene, and enable collision and simulation.
1160 setProcessTick( isDynamic || mPlayAmbient );
1161 if ( isClientObject() )
1162 addToScene();
1163 mPhysicsRep->setSimulationEnabled( true );
1164
1165 mDestroyed = false;
1166 setMaskBits( DamageMask );
1167}
1168
1169DefineEngineMethod( PhysicsShape, isDestroyed, bool, (),,
1170 "@brief Returns if a PhysicsShape has been destroyed or not.\n\n" )

Callers 5

renderFrameFunction · 0.45
_onPhysicsResetMethod · 0.45
physicsShape.cppFile · 0.45
prepRenderImageMethod · 0.45
prepRenderImageMethod · 0.45

Calls 2

deleteObjectMethod · 0.45
setSimulationEnabledMethod · 0.45

Tested by

no test coverage detected