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

Method _onResourceChanged

Engine/source/T3D/physics/physicsShape.cpp:242–268  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

240}
241
242void PhysicsShapeData::_onResourceChanged( const Torque::Path &path )
243{
244 if (mShapeAsset.isNull())
245 return;
246
247 if ( path != Path(mShapeAsset->getShapeFilePath()) )
248 return;
249
250 _setShape(getShape());
251
252 // Reload the changed shape.
253 PhysicsCollisionRef reloadcolShape;
254
255 if ( !mShape )
256 {
257 Con::warnf( ConsoleLogEntry::General, "PhysicsShapeData::_onResourceChanged: Could not reload %s.", path.getFileName().c_str() );
258 return;
259 }
260
261 // Reload the collision shape.
262 reloadcolShape = mShape->buildColShape( false, Point3F::One );
263
264 if ( bool(reloadcolShape))
265 colShape = reloadcolShape;
266
267 mReloadSignal.trigger();
268}
269
270bool PhysicsShapeData::preload( bool server, String &errorBuffer )
271{

Callers

nothing calls this directly

Calls 8

getShapeFilePathMethod · 0.80
getFileNameMethod · 0.80
buildColShapeMethod · 0.80
PathEnum · 0.50
warnfFunction · 0.50
isNullMethod · 0.45
c_strMethod · 0.45
triggerMethod · 0.45

Tested by

no test coverage detected