From 783ef97173a01a93187ef2dbf08403e8c15b9c68 Mon Sep 17 00:00:00 2001 From: ikpil Date: Mon, 31 Jul 2023 15:38:53 +0900 Subject: [PATCH] rename for unity3d --- src/DotRecast.Detour.Dynamic/DynamicTile.cs | 2 +- src/DotRecast.Detour.Extras/BVTreeBuilder.cs | 2 +- src/DotRecast.Detour.Extras/Jumplink/NavMeshGroundSampler.cs | 2 +- src/DotRecast.Detour.Extras/Unity/Astar/OffMeshLinkCreator.cs | 2 +- src/DotRecast.Detour.TileCache/DtTileCache.cs | 2 +- src/DotRecast.Detour/DetourBuilder.cs | 2 +- .../{NavMeshBuilder.cs => DtNavMeshBuilder.cs} | 2 +- .../{NavMeshRaycast.cs => DtNavMeshRaycast.cs} | 2 +- src/DotRecast.Recast.Demo/RecastDemo.cs | 4 ++-- src/DotRecast.Recast.DemoTool/Builder/SoloNavMeshBuilder.cs | 2 +- src/DotRecast.Recast.DemoTool/Builder/TileNavMeshBuilder.cs | 2 +- .../{PolyMeshRaycast.cs => RcPolyMeshRaycast.cs} | 2 +- src/DotRecast.Recast/RecastFilledVolumeRasterization.cs | 3 +-- test/DotRecast.Detour.Crowd.Test/RecastTestMeshBuilder.cs | 2 +- test/DotRecast.Detour.Test/RecastTestMeshBuilder.cs | 2 +- test/DotRecast.Detour.Test/TestTiledNavMeshBuilder.cs | 2 +- 16 files changed, 17 insertions(+), 18 deletions(-) rename src/DotRecast.Detour/{NavMeshBuilder.cs => DtNavMeshBuilder.cs} (99%) rename src/DotRecast.Detour/{NavMeshRaycast.cs => DtNavMeshRaycast.cs} (98%) rename src/DotRecast.Recast/{PolyMeshRaycast.cs => RcPolyMeshRaycast.cs} (98%) diff --git a/src/DotRecast.Detour.Dynamic/DynamicTile.cs b/src/DotRecast.Detour.Dynamic/DynamicTile.cs index 26c9b7c..ab1c069 100644 --- a/src/DotRecast.Detour.Dynamic/DynamicTile.cs +++ b/src/DotRecast.Detour.Dynamic/DynamicTile.cs @@ -51,7 +51,7 @@ namespace DotRecast.Detour.Dynamic RecastBuilderResult r = BuildRecast(builder, config, voxelTile, heightfield, telemetry); DtNavMeshCreateParams option = NavMeshCreateParams(voxelTile.tileX, voxelTile.tileZ, voxelTile.cellSize, voxelTile.cellHeight, config, r); - meshData = NavMeshBuilder.CreateNavMeshData(option); + meshData = DtNavMeshBuilder.CreateNavMeshData(option); return true; } diff --git a/src/DotRecast.Detour.Extras/BVTreeBuilder.cs b/src/DotRecast.Detour.Extras/BVTreeBuilder.cs index c0d1c9a..9d3db7c 100644 --- a/src/DotRecast.Detour.Extras/BVTreeBuilder.cs +++ b/src/DotRecast.Detour.Extras/BVTreeBuilder.cs @@ -57,7 +57,7 @@ namespace DotRecast.Detour.Extras it.bmax[2] = Clamp((int)((bmax.z - data.header.bmin.z) * quantFactor), 0, 0x7fffffff); } - return NavMeshBuilder.Subdivide(items, data.header.polyCount, 0, data.header.polyCount, 0, nodes); + return DtNavMeshBuilder.Subdivide(items, data.header.polyCount, 0, data.header.polyCount, 0, nodes); } } } \ No newline at end of file diff --git a/src/DotRecast.Detour.Extras/Jumplink/NavMeshGroundSampler.cs b/src/DotRecast.Detour.Extras/Jumplink/NavMeshGroundSampler.cs index 4c207b1..b482640 100644 --- a/src/DotRecast.Detour.Extras/Jumplink/NavMeshGroundSampler.cs +++ b/src/DotRecast.Detour.Extras/Jumplink/NavMeshGroundSampler.cs @@ -38,7 +38,7 @@ namespace DotRecast.Detour.Extras.Jumplink option.cs = r.GetMesh().cs; option.ch = r.GetMesh().ch; option.buildBvTree = true; - return new DtNavMeshQuery(new DtNavMesh(NavMeshBuilder.CreateNavMeshData(option), option.nvp, 0)); + return new DtNavMeshQuery(new DtNavMesh(DtNavMeshBuilder.CreateNavMeshData(option), option.nvp, 0)); } diff --git a/src/DotRecast.Detour.Extras/Unity/Astar/OffMeshLinkCreator.cs b/src/DotRecast.Detour.Extras/Unity/Astar/OffMeshLinkCreator.cs index 4692347..98bbc43 100644 --- a/src/DotRecast.Detour.Extras/Unity/Astar/OffMeshLinkCreator.cs +++ b/src/DotRecast.Detour.Extras/Unity/Astar/OffMeshLinkCreator.cs @@ -54,7 +54,7 @@ namespace DotRecast.Detour.Extras.Unity.Astar connection.rad = 0.1f; connection.side = startTile == endTile ? 0xFF - : NavMeshBuilder.ClassifyOffMeshPoint(RcVec3f.Of(connection.pos, 3), startTile.header.bmin, startTile.header.bmax); + : DtNavMeshBuilder.ClassifyOffMeshPoint(RcVec3f.Of(connection.pos, 3), startTile.header.bmin, startTile.header.bmax); connection.userId = (int)l.linkID; if (startTile.offMeshCons == null) { diff --git a/src/DotRecast.Detour.TileCache/DtTileCache.cs b/src/DotRecast.Detour.TileCache/DtTileCache.cs index e9b76d9..484d592 100644 --- a/src/DotRecast.Detour.TileCache/DtTileCache.cs +++ b/src/DotRecast.Detour.TileCache/DtTileCache.cs @@ -665,7 +665,7 @@ namespace DotRecast.Detour.TileCache m_tmproc.Process(option); } - DtMeshData meshData = NavMeshBuilder.CreateNavMeshData(option); + DtMeshData meshData = DtNavMeshBuilder.CreateNavMeshData(option); // Remove existing tile. m_navmesh.RemoveTile(m_navmesh.GetTileRefAt(tile.header.tx, tile.header.ty, tile.header.tlayer)); // Add new tile, or leave the location empty. if (navData) { // Let the diff --git a/src/DotRecast.Detour/DetourBuilder.cs b/src/DotRecast.Detour/DetourBuilder.cs index 583597f..7d1422a 100644 --- a/src/DotRecast.Detour/DetourBuilder.cs +++ b/src/DotRecast.Detour/DetourBuilder.cs @@ -24,7 +24,7 @@ namespace DotRecast.Detour { public DtMeshData Build(DtNavMeshCreateParams option, int tileX, int tileY) { - DtMeshData data = NavMeshBuilder.CreateNavMeshData(option); + DtMeshData data = DtNavMeshBuilder.CreateNavMeshData(option); if (data != null) { data.header.x = tileX; diff --git a/src/DotRecast.Detour/NavMeshBuilder.cs b/src/DotRecast.Detour/DtNavMeshBuilder.cs similarity index 99% rename from src/DotRecast.Detour/NavMeshBuilder.cs rename to src/DotRecast.Detour/DtNavMeshBuilder.cs index b25bbc4..cd7ee62 100644 --- a/src/DotRecast.Detour/NavMeshBuilder.cs +++ b/src/DotRecast.Detour/DtNavMeshBuilder.cs @@ -25,7 +25,7 @@ namespace DotRecast.Detour { using static DotRecast.Core.RcMath; - public static class NavMeshBuilder + public static class DtNavMeshBuilder { const int MESH_NULL_IDX = 0xffff; diff --git a/src/DotRecast.Detour/NavMeshRaycast.cs b/src/DotRecast.Detour/DtNavMeshRaycast.cs similarity index 98% rename from src/DotRecast.Detour/NavMeshRaycast.cs rename to src/DotRecast.Detour/DtNavMeshRaycast.cs index b6c2f40..040391b 100644 --- a/src/DotRecast.Detour/NavMeshRaycast.cs +++ b/src/DotRecast.Detour/DtNavMeshRaycast.cs @@ -24,7 +24,7 @@ namespace DotRecast.Detour /** * Simple helper to find an intersection between a ray and a nav mesh */ - public static class NavMeshRaycast + public static class DtNavMeshRaycast { public static float? Raycast(DtNavMesh mesh, RcVec3f src, RcVec3f dst) { diff --git a/src/DotRecast.Recast.Demo/RecastDemo.cs b/src/DotRecast.Recast.Demo/RecastDemo.cs index 44aeffc..f25613f 100644 --- a/src/DotRecast.Recast.Demo/RecastDemo.cs +++ b/src/DotRecast.Recast.Demo/RecastDemo.cs @@ -778,12 +778,12 @@ public class RecastDemo : IRecastDemoChannel if (!hit.HasValue && _sample.GetNavMesh() != null) { - hit = NavMeshRaycast.Raycast(_sample.GetNavMesh(), rayStart, rayEnd); + hit = DtNavMeshRaycast.Raycast(_sample.GetNavMesh(), rayStart, rayEnd); } if (!hit.HasValue && _sample.GetRecastResults() != null) { - hit = PolyMeshRaycast.Raycast(_sample.GetRecastResults(), rayStart, rayEnd); + hit = RcPolyMeshRaycast.Raycast(_sample.GetRecastResults(), rayStart, rayEnd); } RcVec3f rayDir = RcVec3f.Of(rayEnd.x - rayStart.x, rayEnd.y - rayStart.y, rayEnd.z - rayStart.z); diff --git a/src/DotRecast.Recast.DemoTool/Builder/SoloNavMeshBuilder.cs b/src/DotRecast.Recast.DemoTool/Builder/SoloNavMeshBuilder.cs index f456f48..67032a7 100644 --- a/src/DotRecast.Recast.DemoTool/Builder/SoloNavMeshBuilder.cs +++ b/src/DotRecast.Recast.DemoTool/Builder/SoloNavMeshBuilder.cs @@ -83,7 +83,7 @@ namespace DotRecast.Recast.DemoTool.Builder { DtNavMeshCreateParams option = DemoNavMeshBuilder .GetNavMeshCreateParams(geom, cellSize, cellHeight, agentHeight, agentRadius, agentMaxClimb, result); - var meshData = NavMeshBuilder.CreateNavMeshData(option); + var meshData = DtNavMeshBuilder.CreateNavMeshData(option); if (null == meshData) { return null; diff --git a/src/DotRecast.Recast.DemoTool/Builder/TileNavMeshBuilder.cs b/src/DotRecast.Recast.DemoTool/Builder/TileNavMeshBuilder.cs index b1a9ccb..56d76f9 100644 --- a/src/DotRecast.Recast.DemoTool/Builder/TileNavMeshBuilder.cs +++ b/src/DotRecast.Recast.DemoTool/Builder/TileNavMeshBuilder.cs @@ -103,7 +103,7 @@ namespace DotRecast.Recast.DemoTool.Builder option.tileX = x; option.tileZ = z; - DtMeshData md = NavMeshBuilder.CreateNavMeshData(option); + DtMeshData md = DtNavMeshBuilder.CreateNavMeshData(option); if (md != null) { meshData.Add(DemoNavMeshBuilder.UpdateAreaAndFlags(md)); diff --git a/src/DotRecast.Recast/PolyMeshRaycast.cs b/src/DotRecast.Recast/RcPolyMeshRaycast.cs similarity index 98% rename from src/DotRecast.Recast/PolyMeshRaycast.cs rename to src/DotRecast.Recast/RcPolyMeshRaycast.cs index ac7e7b2..9736df3 100644 --- a/src/DotRecast.Recast/PolyMeshRaycast.cs +++ b/src/DotRecast.Recast/RcPolyMeshRaycast.cs @@ -21,7 +21,7 @@ using DotRecast.Core; namespace DotRecast.Recast { - public static class PolyMeshRaycast + public static class RcPolyMeshRaycast { public static float? Raycast(IList results, RcVec3f src, RcVec3f dst) { diff --git a/src/DotRecast.Recast/RecastFilledVolumeRasterization.cs b/src/DotRecast.Recast/RecastFilledVolumeRasterization.cs index 0defe09..ecae556 100644 --- a/src/DotRecast.Recast/RecastFilledVolumeRasterization.cs +++ b/src/DotRecast.Recast/RecastFilledVolumeRasterization.cs @@ -41,8 +41,7 @@ namespace DotRecast.Recast rectangle => IntersectSphere(rectangle, center, radius * radius)); } - public static void RasterizeCapsule(RcHeightfield hf, RcVec3f start, RcVec3f end, float radius, int area, int flagMergeThr, - RcTelemetry ctx) + public static void RasterizeCapsule(RcHeightfield hf, RcVec3f start, RcVec3f end, float radius, int area, int flagMergeThr, RcTelemetry ctx) { using var timer = ctx.ScopedTimer(RcTimerLabel.RC_TIMER_RASTERIZE_CAPSULE); float[] bounds = diff --git a/test/DotRecast.Detour.Crowd.Test/RecastTestMeshBuilder.cs b/test/DotRecast.Detour.Crowd.Test/RecastTestMeshBuilder.cs index b6b3dd4..7e38ae0 100644 --- a/test/DotRecast.Detour.Crowd.Test/RecastTestMeshBuilder.cs +++ b/test/DotRecast.Detour.Crowd.Test/RecastTestMeshBuilder.cs @@ -104,7 +104,7 @@ public class RecastTestMeshBuilder option.offMeshConUserID = new int[1]; option.offMeshConUserID[0] = 0x4567; option.offMeshConCount = 1; - meshData = NavMeshBuilder.CreateNavMeshData(option); + meshData = DtNavMeshBuilder.CreateNavMeshData(option); } public DtMeshData GetMeshData() diff --git a/test/DotRecast.Detour.Test/RecastTestMeshBuilder.cs b/test/DotRecast.Detour.Test/RecastTestMeshBuilder.cs index 97ad483..662288d 100644 --- a/test/DotRecast.Detour.Test/RecastTestMeshBuilder.cs +++ b/test/DotRecast.Detour.Test/RecastTestMeshBuilder.cs @@ -105,7 +105,7 @@ public class RecastTestMeshBuilder option.offMeshConUserID = new int[1]; option.offMeshConUserID[0] = 0x4567; option.offMeshConCount = 1; - meshData = NavMeshBuilder.CreateNavMeshData(option); + meshData = DtNavMeshBuilder.CreateNavMeshData(option); } public DtMeshData GetMeshData() diff --git a/test/DotRecast.Detour.Test/TestTiledNavMeshBuilder.cs b/test/DotRecast.Detour.Test/TestTiledNavMeshBuilder.cs index 35fca79..8cd740f 100644 --- a/test/DotRecast.Detour.Test/TestTiledNavMeshBuilder.cs +++ b/test/DotRecast.Detour.Test/TestTiledNavMeshBuilder.cs @@ -113,7 +113,7 @@ public class TestTiledNavMeshBuilder option.tileX = result.tileX; option.tileZ = result.tileZ; option.buildBvTree = true; - navMesh.AddTile(NavMeshBuilder.CreateNavMeshData(option), 0, 0); + navMesh.AddTile(DtNavMeshBuilder.CreateNavMeshData(option), 0, 0); } }