| 871 | } |
| 872 | |
| 873 | void BackgroundLoader::updateDynamicChunkId() |
| 874 | { |
| 875 | for(unsigned i = 0; i < mDyncActors.size(); ++i) |
| 876 | { |
| 877 | DynamicObjects* obj = mDyncActors[i]; |
| 878 | PxRigidDynamic* actor = mDyncActors[i] ->actor; |
| 879 | PxVec3 pos; |
| 880 | { |
| 881 | PxSceneReadLock scopedLock(mSampleLargeWorld->getActiveScene()); |
| 882 | pos = actor->getGlobalPose().p; |
| 883 | } |
| 884 | |
| 885 | //Remove the un-important which go out of current grid. |
| 886 | if(obj->isImportant == false && !mLocalBounds.contains(pos)) |
| 887 | { |
| 888 | mRemovingActors.push_back(actor); |
| 889 | obj->actor = NULL; |
| 890 | } |
| 891 | else |
| 892 | { |
| 893 | ChunkID theId = getChunkIdFromPosition(pos, mTerrainRange, mChunkWidth); |
| 894 | obj->id.id = theId.id; |
| 895 | } |
| 896 | } |
| 897 | |
| 898 | std::vector<DynamicObjects*>::iterator new_end = std::remove_if( mDyncActors.begin(), mDyncActors.end(), isActorNULL); |
| 899 | mDyncActors.erase( new_end, mDyncActors.end()); |
| 900 | } |
| 901 | |
| 902 | PxCollection* BackgroundLoader::loadChunk(ChunkID id) |
| 903 | { |
nothing calls this directly
no test coverage detected