add documentation
This commit is contained in:
@@ -10,6 +10,9 @@ using UnityNavMeshBuilder = UnityEngine.AI.NavMeshBuilder;
|
||||
|
||||
namespace InfiniteWorld.VoxelWorld.NavMesh
|
||||
{
|
||||
/// <summary>
|
||||
/// Coordinates clustered runtime NavMesh coverage over the voxel world by rebuilding a bounded set of windows around active interest.
|
||||
/// </summary>
|
||||
public sealed class VoxelWorldNavMeshService : IStartable, ITickable, IDisposable, INavCoverageReader
|
||||
{
|
||||
private readonly IChunkNavSourceReader chunkNavSourceReader;
|
||||
@@ -54,6 +57,9 @@ namespace InfiniteWorld.VoxelWorld.NavMesh
|
||||
this.config = config ?? new VoxelWorldNavMeshConfig();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Subscribes to world invalidation and primes the initial set of coverage windows for the current interest snapshot.
|
||||
/// </summary>
|
||||
public void Start()
|
||||
{
|
||||
subscriptions.Add(chunkReadySubscriber.Subscribe(OnChunkNavGeometryReady));
|
||||
@@ -66,6 +72,9 @@ namespace InfiniteWorld.VoxelWorld.NavMesh
|
||||
MarkAllCoverageWindowsDirty();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Advances the clustered coverage scheduler, refreshing interest and starting bounded asynchronous builds when needed.
|
||||
/// </summary>
|
||||
public void Tick()
|
||||
{
|
||||
RefreshInterestPoints();
|
||||
@@ -92,6 +101,9 @@ namespace InfiniteWorld.VoxelWorld.NavMesh
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns whether the supplied world position is inside a ready coverage window and can be treated as nav-ready.
|
||||
/// </summary>
|
||||
public bool IsPositionCovered(Vector3 worldPosition)
|
||||
{
|
||||
foreach (KeyValuePair<int, NavCoverageWindowRuntime> pair in coverageWindows)
|
||||
@@ -106,6 +118,9 @@ namespace InfiniteWorld.VoxelWorld.NavMesh
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Copies the current runtime coverage windows for diagnostics, readiness checks and higher-level planning.
|
||||
/// </summary>
|
||||
public void GetCoverageWindows(List<NavCoverageWindowSnapshot> results)
|
||||
{
|
||||
if (results == null)
|
||||
@@ -120,6 +135,9 @@ namespace InfiniteWorld.VoxelWorld.NavMesh
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Releases subscriptions and runtime NavMesh data owned by the service.
|
||||
/// </summary>
|
||||
public void Dispose()
|
||||
{
|
||||
for (int i = 0; i < subscriptions.Count; i++)
|
||||
|
||||
Reference in New Issue
Block a user