| 380 | } |
| 381 | |
| 382 | bool TSStatic::_createShape() |
| 383 | { |
| 384 | // Cleanup before we create. |
| 385 | mCollisionDetails.clear(); |
| 386 | mDecalDetails.clear(); |
| 387 | mDecalDetailsPtr = 0; |
| 388 | mLOSDetails.clear(); |
| 389 | SAFE_DELETE(mPhysicsRep); |
| 390 | SAFE_DELETE(mShapeInstance); |
| 391 | mAmbientThread = NULL; |
| 392 | mShape = NULL; |
| 393 | |
| 394 | if(!mShapeAsset.isNull()) |
| 395 | { |
| 396 | //Special-case handling, usually because we set noShape |
| 397 | mShape = mShapeAsset->getShapeResource(); |
| 398 | } |
| 399 | |
| 400 | if (!mShape) |
| 401 | { |
| 402 | Con::errorf("TSStatic::_createShape() - Shape Asset %s had no valid shape!", mShapeAsset.getAssetId()); |
| 403 | return false; |
| 404 | } |
| 405 | |
| 406 | if (isClientObject() && |
| 407 | !mShape->preloadMaterialList(mShape.getPath()) && |
| 408 | NetConnection::filesWereDownloaded()) |
| 409 | return false; |
| 410 | |
| 411 | mObjBox = mShape->mBounds; |
| 412 | resetWorldBox(); |
| 413 | |
| 414 | mShapeInstance = new TSShapeInstance(mShape, isClientObject()); |
| 415 | mShapeInstance->resetMaterialList(); |
| 416 | mShapeInstance->cloneMaterialList(); |
| 417 | |
| 418 | if (isGhost()) |
| 419 | { |
| 420 | // Reapply the current skin |
| 421 | mAppliedSkinName = ""; |
| 422 | reSkin(); |
| 423 | |
| 424 | updateMaterials(); |
| 425 | } |
| 426 | |
| 427 | prepCollision(); |
| 428 | |
| 429 | // Find the "ambient" animation if it exists |
| 430 | S32 ambientSeq = mShape->findSequence("ambient"); |
| 431 | |
| 432 | if (ambientSeq > -1 && !mAmbientThread) |
| 433 | mAmbientThread = mShapeInstance->addThread(); |
| 434 | |
| 435 | if ( mAmbientThread ) |
| 436 | mShapeInstance->setSequence(mAmbientThread, ambientSeq, mAnimOffset); |
| 437 | |
| 438 | // Resolve CubeReflectorDesc. |
| 439 | if (cubeDescName.isNotEmpty()) |
nothing calls this directly
no test coverage detected