| 543 | /////////////////////////////////////////////////////////////////////////////// |
| 544 | |
| 545 | void SampleSubmarine::resetScene() |
| 546 | { |
| 547 | gResetScene = false; |
| 548 | const size_t nbCrabs = mCrabs.size(); |
| 549 | for(PxU32 i=0;i<nbCrabs;i++) |
| 550 | { |
| 551 | delete mCrabs[i]; |
| 552 | } |
| 553 | mCrabs.clear(); |
| 554 | |
| 555 | const size_t nbJoints = mJoints.size(); |
| 556 | for(PxU32 i=0;i<nbJoints;i++) |
| 557 | mJoints[i]->release(); |
| 558 | mJoints.clear(); |
| 559 | |
| 560 | const size_t nbSeamines = mSeamines.size(); |
| 561 | for(PxU32 i=0;i<nbSeamines;i++) |
| 562 | { |
| 563 | const size_t nbLink = mSeamines[i]->mLinks.size(); |
| 564 | for(PxU32 j=0;j<nbLink;j++) |
| 565 | removeActor(mSeamines[i]->mLinks[j]); |
| 566 | removeActor(mSeamines[i]->mMineHead); |
| 567 | delete mSeamines[i]; |
| 568 | } |
| 569 | mSeamines.clear(); |
| 570 | |
| 571 | if(mSubmarineActor) |
| 572 | { |
| 573 | removeActor(mSubmarineActor); |
| 574 | mSubmarineActor = NULL; |
| 575 | } |
| 576 | gSubmarineHealth = 100; |
| 577 | |
| 578 | if (gTreasureActor) |
| 579 | removeActor(gTreasureActor); |
| 580 | gTreasureActor = NULL; |
| 581 | gTreasureFound = false; |
| 582 | |
| 583 | while(mPhysicsActors.size()) |
| 584 | { |
| 585 | removeActor(mPhysicsActors[0]); |
| 586 | } |
| 587 | |
| 588 | freeDeletedActors(); |
| 589 | |
| 590 | createDynamicActors(); |
| 591 | |
| 592 | // init camera orientation |
| 593 | mSubmarineCameraController->init(PxVec3(-90, 60, 50), PxVec3(0.28f, 2.05f, 0.0f)); |
| 594 | mSubmarineCameraController->setMouseSensitivity(0.5f); |
| 595 | mSubmarineCameraController->setFollowingMode(true); |
| 596 | mCameraAttachedToActor = mSubmarineActor; |
| 597 | } |
| 598 | |
| 599 | /////////////////////////////////////////////////////////////////////////////// |
| 600 |
nothing calls this directly
no test coverage detected