MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / buildLinks

Method buildLinks

Engine/source/navigation/navMesh.cpp:1134–1167  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1132}
1133
1134void NavMesh::buildLinks()
1135{
1136 // Make sure we've already built or loaded.
1137 if(!nm)
1138 return;
1139 // Iterate over tiles.
1140 for(U32 i = 0; i < mTiles.size(); i++)
1141 {
1142 const Tile &tile = mTiles[i];
1143 // Iterate over links
1144 for(U32 j = 0; j < mLinkIDs.size(); j++)
1145 {
1146 if (mLinksUnsynced[j])
1147 {
1148 if(tile.box.isContained(getLinkStart(j)) ||
1149 tile.box.isContained(getLinkEnd(j)))
1150 {
1151 // Mark tile for build.
1152 mDirtyTiles.push_back_unique(i);
1153 // Delete link if necessary
1154 if(mDeleteLinks[j])
1155 {
1156 eraseLink(j);
1157 j--;
1158 }
1159 else
1160 mLinksUnsynced[j] = false;
1161 }
1162 }
1163 }
1164 }
1165 if(mDirtyTiles.size())
1166 ctx->startTimer(RC_TIMER_TOTAL);
1167}
1168
1169DefineEngineMethod(NavMesh, buildLinks, void, (),,
1170 "@brief Build tiles of this mesh where there are unsynchronised links.")

Callers 1

navMesh.cppFile · 0.80

Calls 4

push_back_uniqueMethod · 0.80
sizeMethod · 0.45
isContainedMethod · 0.45
startTimerMethod · 0.45

Tested by

no test coverage detected