class to struct DtNavMeshParams, DtTileCacheSetHeader, DtTileCacheParam

This commit is contained in:
ikpil 2023-08-15 12:18:28 +09:00
parent c353672a09
commit e8e64ea351
5 changed files with 13 additions and 14 deletions

View File

@ -22,16 +22,15 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using DotRecast.Core; using DotRecast.Core;
using DotRecast.Detour.TileCache.Io; using DotRecast.Detour.TileCache.Io;
using static DotRecast.Core.RcMath;
namespace DotRecast.Detour.TileCache namespace DotRecast.Detour.TileCache
{ {
public class DtTileCache public class DtTileCache
{ {
int m_tileLutSize; private int m_tileLutSize;
/// < Tile hash lookup size (must be pot). /// < Tile hash lookup size (must be pot).
int m_tileLutMask; private int m_tileLutMask;
/// < Tile hash lookup mask. /// < Tile hash lookup mask.
private readonly DtCompressedTile[] m_posLookup; private readonly DtCompressedTile[] m_posLookup;
@ -719,9 +718,9 @@ namespace DotRecast.Detour.TileCache
} }
} }
public DtTileCacheParams GetParams() public ref readonly DtTileCacheParams GetParams()
{ {
return m_params; return ref m_params;
} }
public IRcCompressor GetCompressor() public IRcCompressor GetCompressor()

View File

@ -22,9 +22,9 @@ using DotRecast.Core;
namespace DotRecast.Detour.TileCache namespace DotRecast.Detour.TileCache
{ {
public class DtTileCacheParams public struct DtTileCacheParams
{ {
public RcVec3f orig = new RcVec3f(); public RcVec3f orig;
public float cs, ch; public float cs, ch;
public int width, height; public int width, height;
public float walkableHeight; public float walkableHeight;

View File

@ -20,7 +20,7 @@ freely, subject to the following restrictions:
namespace DotRecast.Detour.TileCache.Io namespace DotRecast.Detour.TileCache.Io
{ {
public class DtTileCacheSetHeader public struct DtTileCacheSetHeader
{ {
public const int TILECACHESET_MAGIC = 'T' << 24 | 'S' << 16 | 'E' << 8 | 'T'; // 'TSET'; public const int TILECACHESET_MAGIC = 'T' << 24 | 'S' << 16 | 'E' << 8 | 'T'; // 'TSET';
public const int TILECACHESET_VERSION = 1; public const int TILECACHESET_VERSION = 1;
@ -29,7 +29,7 @@ namespace DotRecast.Detour.TileCache.Io
public int magic; public int magic;
public int version; public int version;
public int numTiles; public int numTiles;
public DtNavMeshParams meshParams = new DtNavMeshParams(); public DtNavMeshParams meshParams;
public DtTileCacheParams cacheParams = new DtTileCacheParams(); public DtTileCacheParams cacheParams;
} }
} }

View File

@ -324,9 +324,9 @@ namespace DotRecast.Detour
return true; return true;
} }
public DtNavMeshParams GetParams() public ref readonly DtNavMeshParams GetParams()
{ {
return m_params; return ref m_params;
} }

View File

@ -28,10 +28,10 @@ namespace DotRecast.Detour
* *
* @see NavMesh * @see NavMesh
*/ */
public class DtNavMeshParams public struct DtNavMeshParams
{ {
/** The world space origin of the navigation mesh's tile space. [(x, y, z)] */ /** The world space origin of the navigation mesh's tile space. [(x, y, z)] */
public RcVec3f orig = new RcVec3f(); public RcVec3f orig;
/** The width of each tile. (Along the x-axis.) */ /** The width of each tile. (Along the x-axis.) */
public float tileWidth; public float tileWidth;