MCPcopy Create free account
hub / github.com/NVIDIAGameWorks/PhysX / updateDynamicChunkId

Method updateDynamicChunkId

physx/samples/samplelargeworld/ChunkLoader.cpp:873–900  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

871}
872
873void 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
902PxCollection* BackgroundLoader::loadChunk(ChunkID id)
903{

Callers

nothing calls this directly

Calls 7

getChunkIdFromPositionFunction · 0.85
sizeMethod · 0.45
getGlobalPoseMethod · 0.45
containsMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
eraseMethod · 0.45

Tested by

no test coverage detected