diff --git a/src/DotRecast.Detour.TileCache/DtTileCache.cs b/src/DotRecast.Detour.TileCache/DtTileCache.cs index 11abac4..5262231 100644 --- a/src/DotRecast.Detour.TileCache/DtTileCache.cs +++ b/src/DotRecast.Detour.TileCache/DtTileCache.cs @@ -22,16 +22,15 @@ using System; using System.Collections.Generic; using DotRecast.Core; using DotRecast.Detour.TileCache.Io; -using static DotRecast.Core.RcMath; namespace DotRecast.Detour.TileCache { public class DtTileCache { - int m_tileLutSize; + private int m_tileLutSize; /// < Tile hash lookup size (must be pot). - int m_tileLutMask; + private int m_tileLutMask; /// < Tile hash lookup mask. 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() diff --git a/src/DotRecast.Detour.TileCache/DtTileCacheParams.cs b/src/DotRecast.Detour.TileCache/DtTileCacheParams.cs index 53d79e8..fc66edf 100644 --- a/src/DotRecast.Detour.TileCache/DtTileCacheParams.cs +++ b/src/DotRecast.Detour.TileCache/DtTileCacheParams.cs @@ -22,9 +22,9 @@ using DotRecast.Core; namespace DotRecast.Detour.TileCache { - public class DtTileCacheParams + public struct DtTileCacheParams { - public RcVec3f orig = new RcVec3f(); + public RcVec3f orig; public float cs, ch; public int width, height; public float walkableHeight; diff --git a/src/DotRecast.Detour.TileCache/Io/DtTileCacheSetHeader.cs b/src/DotRecast.Detour.TileCache/Io/DtTileCacheSetHeader.cs index c1ecc9a..85f31b6 100644 --- a/src/DotRecast.Detour.TileCache/Io/DtTileCacheSetHeader.cs +++ b/src/DotRecast.Detour.TileCache/Io/DtTileCacheSetHeader.cs @@ -20,7 +20,7 @@ freely, subject to the following restrictions: 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_VERSION = 1; @@ -29,7 +29,7 @@ namespace DotRecast.Detour.TileCache.Io public int magic; public int version; public int numTiles; - public DtNavMeshParams meshParams = new DtNavMeshParams(); - public DtTileCacheParams cacheParams = new DtTileCacheParams(); + public DtNavMeshParams meshParams; + public DtTileCacheParams cacheParams; } } \ No newline at end of file diff --git a/src/DotRecast.Detour/DtNavMesh.cs b/src/DotRecast.Detour/DtNavMesh.cs index 0a3365a..a48bd01 100644 --- a/src/DotRecast.Detour/DtNavMesh.cs +++ b/src/DotRecast.Detour/DtNavMesh.cs @@ -324,9 +324,9 @@ namespace DotRecast.Detour return true; } - public DtNavMeshParams GetParams() + public ref readonly DtNavMeshParams GetParams() { - return m_params; + return ref m_params; } diff --git a/src/DotRecast.Detour/DtNavMeshParams.cs b/src/DotRecast.Detour/DtNavMeshParams.cs index 414100e..ddaba1d 100644 --- a/src/DotRecast.Detour/DtNavMeshParams.cs +++ b/src/DotRecast.Detour/DtNavMeshParams.cs @@ -28,10 +28,10 @@ namespace DotRecast.Detour * * @see NavMesh */ - public class DtNavMeshParams + public struct DtNavMeshParams { /** 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.) */ public float tileWidth;