mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-16 18:29:55 +00:00
Log worldspace in RecastContext
This commit is contained in:
parent
e6e6b65ab3
commit
180dd7dc64
6 changed files with 20 additions and 14 deletions
|
@ -433,8 +433,8 @@ namespace DetourNavigator
|
|||
return JobStatus::MemoryCacheMiss;
|
||||
}
|
||||
|
||||
preparedNavMeshData
|
||||
= prepareNavMeshTileData(*recastMesh, job.mChangedTile, job.mAgentBounds, mSettings.get().mRecast);
|
||||
preparedNavMeshData = prepareNavMeshTileData(
|
||||
*recastMesh, job.mWorldspace, job.mChangedTile, job.mAgentBounds, mSettings.get().mRecast);
|
||||
|
||||
if (preparedNavMeshData == nullptr)
|
||||
{
|
||||
|
@ -483,8 +483,8 @@ namespace DetourNavigator
|
|||
|
||||
if (preparedNavMeshData == nullptr)
|
||||
{
|
||||
preparedNavMeshData
|
||||
= prepareNavMeshTileData(*job.mRecastMesh, job.mChangedTile, job.mAgentBounds, mSettings.get().mRecast);
|
||||
preparedNavMeshData = prepareNavMeshTileData(
|
||||
*job.mRecastMesh, job.mWorldspace, job.mChangedTile, job.mAgentBounds, mSettings.get().mRecast);
|
||||
generatedNavMeshData = true;
|
||||
}
|
||||
|
||||
|
|
|
@ -79,7 +79,8 @@ namespace DetourNavigator
|
|||
return;
|
||||
}
|
||||
|
||||
const auto data = prepareNavMeshTileData(*recastMesh, mTilePosition, mAgentBounds, mSettings.mRecast);
|
||||
const auto data
|
||||
= prepareNavMeshTileData(*recastMesh, mWorldspace, mTilePosition, mAgentBounds, mSettings.mRecast);
|
||||
|
||||
if (data == nullptr)
|
||||
return;
|
||||
|
|
|
@ -517,9 +517,10 @@ namespace DetourNavigator
|
|||
namespace DetourNavigator
|
||||
{
|
||||
std::unique_ptr<PreparedNavMeshData> prepareNavMeshTileData(const RecastMesh& recastMesh,
|
||||
const TilePosition& tilePosition, const AgentBounds& agentBounds, const RecastSettings& settings)
|
||||
std::string_view worldspace, const TilePosition& tilePosition, const AgentBounds& agentBounds,
|
||||
const RecastSettings& settings)
|
||||
{
|
||||
RecastContext context(tilePosition, agentBounds);
|
||||
RecastContext context(worldspace, tilePosition, agentBounds);
|
||||
|
||||
const auto [minZ, maxZ] = getBoundsByZ(recastMesh, agentBounds.mHalfExtents.z(), settings);
|
||||
|
||||
|
|
|
@ -42,7 +42,8 @@ namespace DetourNavigator
|
|||
}
|
||||
|
||||
std::unique_ptr<PreparedNavMeshData> prepareNavMeshTileData(const RecastMesh& recastMesh,
|
||||
const TilePosition& tilePosition, const AgentBounds& agentBounds, const RecastSettings& settings);
|
||||
std::string_view worldspace, const TilePosition& tilePosition, const AgentBounds& agentBounds,
|
||||
const RecastSettings& settings);
|
||||
|
||||
NavMeshData makeNavMeshTileData(const PreparedNavMeshData& data,
|
||||
const std::vector<OffMeshConnection>& offMeshConnections, const AgentBounds& agentBounds,
|
||||
|
|
|
@ -23,17 +23,19 @@ namespace DetourNavigator
|
|||
return Debug::Debug;
|
||||
}
|
||||
|
||||
std::string formatPrefix(const TilePosition& tilePosition, const AgentBounds& agentBounds)
|
||||
std::string formatPrefix(
|
||||
std::string_view worldspace, const TilePosition& tilePosition, const AgentBounds& agentBounds)
|
||||
{
|
||||
std::ostringstream stream;
|
||||
stream << "Tile position: " << tilePosition.x() << ", " << tilePosition.y()
|
||||
<< "; agent bounds: " << agentBounds << "; ";
|
||||
stream << "Worldspace: " << worldspace << "; tile position: " << tilePosition.x() << ", "
|
||||
<< tilePosition.y() << "; agent bounds: " << agentBounds << "; ";
|
||||
return stream.str();
|
||||
}
|
||||
}
|
||||
|
||||
RecastContext::RecastContext(const TilePosition& tilePosition, const AgentBounds& agentBounds)
|
||||
: mPrefix(formatPrefix(tilePosition, agentBounds))
|
||||
RecastContext::RecastContext(
|
||||
std::string_view worldspace, const TilePosition& tilePosition, const AgentBounds& agentBounds)
|
||||
: mPrefix(formatPrefix(worldspace, tilePosition, agentBounds))
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -14,7 +14,8 @@ namespace DetourNavigator
|
|||
class RecastContext final : public rcContext
|
||||
{
|
||||
public:
|
||||
explicit RecastContext(const TilePosition& tilePosition, const AgentBounds& agentBounds);
|
||||
explicit RecastContext(
|
||||
std::string_view worldspace, const TilePosition& tilePosition, const AgentBounds& agentBounds);
|
||||
|
||||
const std::string& getPrefix() const { return mPrefix; }
|
||||
|
||||
|
|
Loading…
Reference in a new issue