| 290 | ); |
| 291 | |
| 292 | PhysicsDebris* 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 | |
| 317 | PhysicsDebris::PhysicsDebris() |
| 318 | : mLifetime( 0.0f ), |
nothing calls this directly
no test coverage detected