MCPcopy Create free account
hub / github.com/GarageGames/Torque3D / updateTiles

Method updateTiles

Engine/source/navigation/navMesh.cpp:740–787  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

738}
739
740void NavMesh::updateTiles(bool dirty)
741{
742 if(!isProperlyAdded())
743 return;
744
745 mTiles.clear();
746 mTileData.clear();
747 mDirtyTiles.clear();
748
749 const Box3F &box = DTStoRC(getWorldBox());
750 if(box.isEmpty())
751 return;
752
753 updateConfig();
754
755 // Calculate tile dimensions.
756 const U32 ts = cfg.tileSize;
757 const U32 tw = (cfg.width + ts-1) / ts;
758 const U32 th = (cfg.height + ts-1) / ts;
759 const F32 tcs = cfg.tileSize * cfg.cs;
760
761 // Iterate over tiles.
762 F32 tileBmin[3], tileBmax[3];
763 for(U32 y = 0; y < th; ++y)
764 {
765 for(U32 x = 0; x < tw; ++x)
766 {
767 tileBmin[0] = cfg.bmin[0] + x*tcs;
768 tileBmin[1] = cfg.bmin[1];
769 tileBmin[2] = cfg.bmin[2] + y*tcs;
770
771 tileBmax[0] = cfg.bmin[0] + (x+1)*tcs;
772 tileBmax[1] = cfg.bmax[1];
773 tileBmax[2] = cfg.bmin[2] + (y+1)*tcs;
774
775 mTiles.push_back(
776 Tile(RCtoDTS(tileBmin, tileBmax),
777 x, y,
778 tileBmin, tileBmax));
779
780 if(dirty)
781 mDirtyTiles.push_back_unique(mTiles.size() - 1);
782
783 if(mSaveIntermediates)
784 mTileData.increment();
785 }
786 }
787}
788
789void NavMesh::processTick(const Move *move)
790{

Callers

nothing calls this directly

Calls 9

DTStoRCFunction · 0.85
TileClass · 0.85
RCtoDTSFunction · 0.85
push_back_uniqueMethod · 0.80
incrementMethod · 0.80
clearMethod · 0.45
isEmptyMethod · 0.45
push_backMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected