mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-04-29 16:25:42 +00:00
Merge pull request #1974 from Azaezel/navmeshProfiling
profiling blocks for navmesh subsystem analysis
This commit is contained in:
commit
229132652e
2 changed files with 11 additions and 4 deletions
|
|
@ -739,6 +739,7 @@ Box3F NavMesh::getTileBox(U32 id)
|
||||||
|
|
||||||
void NavMesh::updateTiles(bool dirty)
|
void NavMesh::updateTiles(bool dirty)
|
||||||
{
|
{
|
||||||
|
PROFILE_SCOPE(NavMesh_updateTiles);
|
||||||
if(!isProperlyAdded())
|
if(!isProperlyAdded())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
@ -793,6 +794,7 @@ void NavMesh::processTick(const Move *move)
|
||||||
|
|
||||||
void NavMesh::buildNextTile()
|
void NavMesh::buildNextTile()
|
||||||
{
|
{
|
||||||
|
PROFILE_SCOPE(NavMesh_buildNextTile);
|
||||||
if(!mDirtyTiles.empty())
|
if(!mDirtyTiles.empty())
|
||||||
{
|
{
|
||||||
// Pop a single dirty tile and process it.
|
// Pop a single dirty tile and process it.
|
||||||
|
|
@ -1099,6 +1101,7 @@ unsigned char *NavMesh::buildTileData(const Tile &tile, TileData &data, U32 &dat
|
||||||
/// this NavMesh object.
|
/// this NavMesh object.
|
||||||
void NavMesh::buildTiles(const Box3F &box)
|
void NavMesh::buildTiles(const Box3F &box)
|
||||||
{
|
{
|
||||||
|
PROFILE_SCOPE(NavMesh_buildTiles);
|
||||||
// Make sure we've already built or loaded.
|
// Make sure we've already built or loaded.
|
||||||
if(!nm)
|
if(!nm)
|
||||||
return;
|
return;
|
||||||
|
|
@ -1124,6 +1127,7 @@ DefineEngineMethod(NavMesh, buildTiles, void, (Box3F box),,
|
||||||
|
|
||||||
void NavMesh::buildTile(const U32 &tile)
|
void NavMesh::buildTile(const U32 &tile)
|
||||||
{
|
{
|
||||||
|
PROFILE_SCOPE(NavMesh_buildTile);
|
||||||
if(tile < mTiles.size())
|
if(tile < mTiles.size())
|
||||||
{
|
{
|
||||||
mDirtyTiles.push_back_unique(tile);
|
mDirtyTiles.push_back_unique(tile);
|
||||||
|
|
|
||||||
|
|
@ -369,6 +369,7 @@ void NavPath::resize()
|
||||||
|
|
||||||
bool NavPath::plan()
|
bool NavPath::plan()
|
||||||
{
|
{
|
||||||
|
PROFILE_SCOPE(NavPath_plan);
|
||||||
// Initialise filter.
|
// Initialise filter.
|
||||||
mFilter.setIncludeFlags(mLinkTypes.getFlags());
|
mFilter.setIncludeFlags(mLinkTypes.getFlags());
|
||||||
|
|
||||||
|
|
@ -430,15 +431,15 @@ bool NavPath::visitNext()
|
||||||
|
|
||||||
if(dtStatusFailed(mQuery->findNearestPoly(from, extents, &mFilter, &startRef, NULL)) || !startRef)
|
if(dtStatusFailed(mQuery->findNearestPoly(from, extents, &mFilter, &startRef, NULL)) || !startRef)
|
||||||
{
|
{
|
||||||
Con::errorf("No NavMesh polygon near visit point (%g, %g, %g) of NavPath %s",
|
//Con::errorf("No NavMesh polygon near visit point (%g, %g, %g) of NavPath %s",
|
||||||
start.x, start.y, start.z, getIdString());
|
//start.x, start.y, start.z, getIdString());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(dtStatusFailed(mQuery->findNearestPoly(to, extents, &mFilter, &endRef, NULL)) || !endRef)
|
if(dtStatusFailed(mQuery->findNearestPoly(to, extents, &mFilter, &endRef, NULL)) || !endRef)
|
||||||
{
|
{
|
||||||
Con::errorf("No NavMesh polygon near visit point (%g, %g, %g) of NavPath %s",
|
//Con::errorf("No NavMesh polygon near visit point (%g, %g, %g) of NavPath %s",
|
||||||
end.x, end.y, end.z, getIdString());
|
//end.x, end.y, end.z, getIdString());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -452,6 +453,7 @@ bool NavPath::visitNext()
|
||||||
|
|
||||||
bool NavPath::update()
|
bool NavPath::update()
|
||||||
{
|
{
|
||||||
|
PROFILE_SCOPE(NavPath_update);
|
||||||
if(dtStatusInProgress(mStatus))
|
if(dtStatusInProgress(mStatus))
|
||||||
mStatus = mQuery->updateSlicedFindPath(mMaxIterations, NULL);
|
mStatus = mQuery->updateSlicedFindPath(mMaxIterations, NULL);
|
||||||
if(dtStatusSucceed(mStatus))
|
if(dtStatusSucceed(mStatus))
|
||||||
|
|
@ -527,6 +529,7 @@ bool NavPath::finalise()
|
||||||
|
|
||||||
void NavPath::processTick(const Move *move)
|
void NavPath::processTick(const Move *move)
|
||||||
{
|
{
|
||||||
|
PROFILE_SCOPE(NavPath_processTick);
|
||||||
if(!mMesh)
|
if(!mMesh)
|
||||||
if(Sim::findObject(mMeshName.c_str(), mMesh))
|
if(Sim::findObject(mMeshName.c_str(), mMesh))
|
||||||
plan();
|
plan();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue