| 320 | } |
| 321 | |
| 322 | bool TSStatic::_createShape() |
| 323 | { |
| 324 | // Cleanup before we create. |
| 325 | mCollisionDetails.clear(); |
| 326 | mLOSDetails.clear(); |
| 327 | SAFE_DELETE( mPhysicsRep ); |
| 328 | SAFE_DELETE( mShapeInstance ); |
| 329 | mAmbientThread = NULL; |
| 330 | mShape = NULL; |
| 331 | |
| 332 | if (!mShapeName || mShapeName[0] == '\0') |
| 333 | { |
| 334 | Con::errorf( "TSStatic::_createShape() - No shape name!" ); |
| 335 | return false; |
| 336 | } |
| 337 | |
| 338 | mShapeHash = _StringTable::hashString(mShapeName); |
| 339 | |
| 340 | mShape = ResourceManager::get().load(mShapeName); |
| 341 | if ( bool(mShape) == false ) |
| 342 | { |
| 343 | Con::errorf( "TSStatic::_createShape() - Unable to load shape: %s", mShapeName ); |
| 344 | return false; |
| 345 | } |
| 346 | |
| 347 | if ( isClientObject() && |
| 348 | !mShape->preloadMaterialList(mShape.getPath()) && |
| 349 | NetConnection::filesWereDownloaded() ) |
| 350 | return false; |
| 351 | |
| 352 | mObjBox = mShape->bounds; |
| 353 | resetWorldBox(); |
| 354 | |
| 355 | mShapeInstance = new TSShapeInstance( mShape, isClientObject() ); |
| 356 | |
| 357 | if( isGhost() ) |
| 358 | { |
| 359 | // Reapply the current skin |
| 360 | mAppliedSkinName = ""; |
| 361 | reSkin(); |
| 362 | } |
| 363 | |
| 364 | prepCollision(); |
| 365 | |
| 366 | // Find the "ambient" animation if it exists |
| 367 | S32 ambientSeq = mShape->findSequence("ambient"); |
| 368 | |
| 369 | if ( ambientSeq > -1 && !mAmbientThread ) |
| 370 | mAmbientThread = mShapeInstance->addThread(); |
| 371 | |
| 372 | if ( mAmbientThread ) |
| 373 | mShapeInstance->setSequence( mAmbientThread, ambientSeq, 0); |
| 374 | |
| 375 | // Resolve CubeReflectorDesc. |
| 376 | if ( cubeDescName.isNotEmpty() ) |
| 377 | { |
| 378 | Sim::findObject( cubeDescName, reflectorDesc ); |
| 379 | } |
nothing calls this directly
no test coverage detected