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

Method create

Engine/source/T3D/physics/physicsDebris.cpp:292–315  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

290);
291
292PhysicsDebris* PhysicsDebris::create( PhysicsDebrisData *datablock,
293 const MatrixF &transform,
294 const VectorF &linVel )
295{
296 // Skip out if we don't have a datablock or the
297 // global lifetime scale has it living less than
298 // a second.
299 if ( !datablock ||
300 ( datablock->lifetime > 0.0f &&
301 datablock->lifetime * smLifetimeScale < 1.0f ) )
302 return NULL;
303
304 PhysicsDebris *debris = new PhysicsDebris();
305 debris->setDataBlock( datablock );
306 debris->setTransform( transform );
307 debris->mInitialLinVel = linVel;
308 if ( !debris->registerObject() )
309 {
310 delete debris;
311 return NULL;
312 }
313
314 return debris;
315}
316
317PhysicsDebris::PhysicsDebris()
318 : mLifetime( 0.0f ),

Callers

nothing calls this directly

Calls 3

setDataBlockMethod · 0.80
setTransformMethod · 0.45
registerObjectMethod · 0.45

Tested by

no test coverage detected