diff --git a/CHANGELOG.md b/CHANGELOG.md index d09eff3..febdd1e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Fix raycast shortcuts ([@Sarofc](https://github.com/Sarofc)) [#72](https://github.com/ikpil/DotRecast/issues/72) - Fix dynamic mesh bounds calculation ([@ppiastucki](https://github.com/ppiastucki)) [#77](https://github.com/ikpil/DotRecast/issues/77) - issuer : [@OhJeongrok](https://github.com/OhJeongrok) +- Fix Support non-tiled dynamic nav meshes ([@ppiastucki](https://github.com/ppiastucki)) ### Changed - Changed data structure of 'neis' from List to byte[] for optimized memory usage and improved access speed in `DtLayerMonotoneRegion` diff --git a/src/DotRecast.Detour.Dynamic/DtDynamicNavMesh.cs b/src/DotRecast.Detour.Dynamic/DtDynamicNavMesh.cs index 82a0104..5c5a253 100644 --- a/src/DotRecast.Detour.Dynamic/DtDynamicNavMesh.cs +++ b/src/DotRecast.Detour.Dynamic/DtDynamicNavMesh.cs @@ -62,8 +62,8 @@ namespace DotRecast.Detour.Dynamic navMeshParams.orig.X = voxelFile.bounds[0]; navMeshParams.orig.Y = voxelFile.bounds[1]; navMeshParams.orig.Z = voxelFile.bounds[2]; - navMeshParams.tileWidth = voxelFile.cellSize * voxelFile.tileSizeX; - navMeshParams.tileHeight = voxelFile.cellSize * voxelFile.tileSizeZ; + navMeshParams.tileWidth = voxelFile.useTiles ? voxelFile.cellSize * voxelFile.tileSizeX : voxelFile.bounds[3] - voxelFile.bounds[0]; + navMeshParams.tileHeight = voxelFile.useTiles ? voxelFile.cellSize * voxelFile.tileSizeZ: voxelFile.bounds[5] - voxelFile.bounds[2]; navMeshParams.maxTiles = voxelFile.tiles.Count; navMeshParams.maxPolys = 0x8000; foreach (var t in voxelFile.tiles)