| 1145 | } |
| 1146 | |
| 1147 | void 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 | |
| 1169 | DefineEngineMethod( PhysicsShape, isDestroyed, bool, (),, |
| 1170 | "@brief Returns if a PhysicsShape has been destroyed or not.\n\n" ) |
no test coverage detected