fix: Support non-tiled dynamic nav meshes (@ppiastucki)

[Upstream] from recast4j
- fe071aa - fix: Support non-tiled dynamic nav meshes (#205)
This commit is contained in:
ikpil 2024-09-21 03:13:51 +09:00
parent 2d0e2f8525
commit 85e2484505
2 changed files with 3 additions and 2 deletions

View File

@ -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 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) - Fix dynamic mesh bounds calculation ([@ppiastucki](https://github.com/ppiastucki)) [#77](https://github.com/ikpil/DotRecast/issues/77)
- issuer : [@OhJeongrok](https://github.com/OhJeongrok) - issuer : [@OhJeongrok](https://github.com/OhJeongrok)
- Fix Support non-tiled dynamic nav meshes ([@ppiastucki](https://github.com/ppiastucki))
### Changed ### Changed
- Changed data structure of 'neis' from List<byte> to byte[] for optimized memory usage and improved access speed in `DtLayerMonotoneRegion` - Changed data structure of 'neis' from List<byte> to byte[] for optimized memory usage and improved access speed in `DtLayerMonotoneRegion`

View File

@ -62,8 +62,8 @@ namespace DotRecast.Detour.Dynamic
navMeshParams.orig.X = voxelFile.bounds[0]; navMeshParams.orig.X = voxelFile.bounds[0];
navMeshParams.orig.Y = voxelFile.bounds[1]; navMeshParams.orig.Y = voxelFile.bounds[1];
navMeshParams.orig.Z = voxelFile.bounds[2]; navMeshParams.orig.Z = voxelFile.bounds[2];
navMeshParams.tileWidth = voxelFile.cellSize * voxelFile.tileSizeX; navMeshParams.tileWidth = voxelFile.useTiles ? voxelFile.cellSize * voxelFile.tileSizeX : voxelFile.bounds[3] - voxelFile.bounds[0];
navMeshParams.tileHeight = voxelFile.cellSize * voxelFile.tileSizeZ; navMeshParams.tileHeight = voxelFile.useTiles ? voxelFile.cellSize * voxelFile.tileSizeZ: voxelFile.bounds[5] - voxelFile.bounds[2];
navMeshParams.maxTiles = voxelFile.tiles.Count; navMeshParams.maxTiles = voxelFile.tiles.Count;
navMeshParams.maxPolys = 0x8000; navMeshParams.maxPolys = 0x8000;
foreach (var t in voxelFile.tiles) foreach (var t in voxelFile.tiles)