This commit is contained in:
ikpil 2023-05-09 22:57:42 +09:00
parent 7677add89e
commit 4ded5e0529
11 changed files with 86 additions and 80 deletions

View File

@ -41,23 +41,23 @@ namespace DotRecast.Detour.TileCache.Io.Compress
private static readonly int MIN_RECOMENDED_LENGTH_FOR_LEVEL_2 = 1024 * 64; private static readonly int MIN_RECOMENDED_LENGTH_FOR_LEVEL_2 = 1024 * 64;
static readonly int MAGIC_NUMBER = 'F' << 16 | 'L' << 8 | 'Z'; private static readonly int MAGIC_NUMBER = 'F' << 16 | 'L' << 8 | 'Z';
static readonly byte BLOCK_TYPE_NON_COMPRESSED = 0x00; private static readonly byte BLOCK_TYPE_NON_COMPRESSED = 0x00;
static readonly byte BLOCK_TYPE_COMPRESSED = 0x01; private static readonly byte BLOCK_TYPE_COMPRESSED = 0x01;
static readonly byte BLOCK_WITHOUT_CHECKSUM = 0x00; private static readonly byte BLOCK_WITHOUT_CHECKSUM = 0x00;
static readonly byte BLOCK_WITH_CHECKSUM = 0x10; private static readonly byte BLOCK_WITH_CHECKSUM = 0x10;
static readonly int OPTIONS_OFFSET = 3; private static readonly int OPTIONS_OFFSET = 3;
static readonly int CHECKSUM_OFFSET = 4; private static readonly int CHECKSUM_OFFSET = 4;
static readonly int MAX_CHUNK_LENGTH = 0xFFFF; private static readonly int MAX_CHUNK_LENGTH = 0xFFFF;
/** /**
* Do not call {@link #Compress(byte[], int, int, byte[], int, int)} for input buffers * Do not call {@link #Compress(byte[], int, int, byte[], int, int)} for input buffers
* which length less than this value. * which length less than this value.
*/ */
static readonly int MIN_LENGTH_TO_COMPRESSION = 32; private static readonly int MIN_LENGTH_TO_COMPRESSION = 32;
/** /**
* In this case {@link #Compress(byte[], int, int, byte[], int, int)} will choose level * In this case {@link #Compress(byte[], int, int, byte[], int, int)} will choose level
@ -65,17 +65,17 @@ namespace DotRecast.Detour.TileCache.Io.Compress
* {@link #MIN_RECOMENDED_LENGTH_FOR_LEVEL_2} {@link #LEVEL_1} will be choosen, * {@link #MIN_RECOMENDED_LENGTH_FOR_LEVEL_2} {@link #LEVEL_1} will be choosen,
* otherwise {@link #LEVEL_2}. * otherwise {@link #LEVEL_2}.
*/ */
static readonly int LEVEL_AUTO = 0; private static readonly int LEVEL_AUTO = 0;
/** /**
* Level 1 is the fastest compression and generally useful for short data. * Level 1 is the fastest compression and generally useful for short data.
*/ */
static readonly int LEVEL_1 = 1; private static readonly int LEVEL_1 = 1;
/** /**
* Level 2 is slightly slower but it gives better compression ratio. * Level 2 is slightly slower but it gives better compression ratio.
*/ */
static readonly int LEVEL_2 = 2; private static readonly int LEVEL_2 = 2;
/** /**
* The output buffer must be at least 6% larger than the input buffer and can not be smaller than 66 bytes. * The output buffer must be at least 6% larger than the input buffer and can not be smaller than 66 bytes.

View File

@ -35,11 +35,6 @@ namespace DotRecast.Detour.TileCache
const int DT_TILECACHE_NULL_IDX = 0xffff; const int DT_TILECACHE_NULL_IDX = 0xffff;
private readonly TileCacheLayerHeaderReader reader = new TileCacheLayerHeaderReader(); private readonly TileCacheLayerHeaderReader reader = new TileCacheLayerHeaderReader();
public void BuildTileCacheRegions(TileCacheLayer layer, int walkableClimb) public void BuildTileCacheRegions(TileCacheLayer layer, int walkableClimb)

View File

@ -36,32 +36,6 @@ using static DotRecast.Core.RecastMath;
namespace DotRecast.Recast.Demo.Tools; namespace DotRecast.Recast.Demo.Tools;
public class CrowdToolMode
{
public static readonly CrowdToolMode CREATE = new(0, "Create Agents");
public static readonly CrowdToolMode MOVE_TARGET = new(1, "Move Target");
public static readonly CrowdToolMode SELECT = new(2, "Select Agent");
public static readonly CrowdToolMode TOGGLE_POLYS = new(3, "Toggle Polys");
public static readonly CrowdToolMode PROFILING = new(4, "Profiling");
public static readonly ImmutableArray<CrowdToolMode> Values = ImmutableArray.Create(
CREATE,
MOVE_TARGET,
SELECT,
TOGGLE_POLYS,
PROFILING
);
public int Idx { get; }
public string Label { get; }
private CrowdToolMode(int idx, string label)
{
Idx = idx;
Label = label;
}
}
public class CrowdTool : Tool public class CrowdTool : Tool
{ {
private readonly CrowdToolParams toolParams = new CrowdToolParams(); private readonly CrowdToolParams toolParams = new CrowdToolParams();

View File

@ -0,0 +1,29 @@
using System.Collections.Immutable;
namespace DotRecast.Recast.Demo.Tools;
public class CrowdToolMode
{
public static readonly CrowdToolMode CREATE = new(0, "Create Agents");
public static readonly CrowdToolMode MOVE_TARGET = new(1, "Move Target");
public static readonly CrowdToolMode SELECT = new(2, "Select Agent");
public static readonly CrowdToolMode TOGGLE_POLYS = new(3, "Toggle Polys");
public static readonly CrowdToolMode PROFILING = new(4, "Profiling");
public static readonly ImmutableArray<CrowdToolMode> Values = ImmutableArray.Create(
CREATE,
MOVE_TARGET,
SELECT,
TOGGLE_POLYS,
PROFILING
);
public int Idx { get; }
public string Label { get; }
private CrowdToolMode(int idx, string label)
{
Idx = idx;
Label = label;
}
}

View File

@ -0,0 +1,11 @@
using DotRecast.Core;
namespace DotRecast.Recast.Geom
{
public class BoundsItem
{
public Vector2f bmin;
public Vector2f bmax;
public int i;
}
}

View File

@ -24,29 +24,6 @@ using DotRecast.Core;
namespace DotRecast.Recast.Geom namespace DotRecast.Recast.Geom
{ {
public class BoundsItem
{
public Vector2f bmin;
public Vector2f bmax;
public int i;
}
public class CompareItemX : IComparer<BoundsItem>
{
public int Compare(BoundsItem a, BoundsItem b)
{
return a.bmin.x.CompareTo(b.bmin.x);
}
}
public class CompareItemY : IComparer<BoundsItem>
{
public int Compare(BoundsItem a, BoundsItem b)
{
return a.bmin.y.CompareTo(b.bmin.y);
}
}
public class ChunkyTriMesh public class ChunkyTriMesh
{ {
List<ChunkyTriMeshNode> nodes; List<ChunkyTriMeshNode> nodes;

View File

@ -0,0 +1,12 @@
using System.Collections.Generic;
namespace DotRecast.Recast.Geom
{
public class CompareItemX : IComparer<BoundsItem>
{
public int Compare(BoundsItem a, BoundsItem b)
{
return a.bmin.x.CompareTo(b.bmin.x);
}
}
}

View File

@ -0,0 +1,12 @@
using System.Collections.Generic;
namespace DotRecast.Recast.Geom
{
public class CompareItemY : IComparer<BoundsItem>
{
public int Compare(BoundsItem a, BoundsItem b)
{
return a.bmin.y.CompareTo(b.bmin.y);
}
}
}

View File

@ -0,0 +1,7 @@
namespace DotRecast.Recast
{
public interface IRecastBuilderProgressListener
{
void OnProgress(int completed, int total);
}
}

View File

@ -1,6 +0,0 @@
namespace DotRecast.Recast
{
public class InputGeomReader
{
}
}

View File

@ -29,11 +29,6 @@ namespace DotRecast.Recast
{ {
public class RecastBuilder public class RecastBuilder
{ {
public interface IRecastBuilderProgressListener
{
void OnProgress(int completed, int total);
}
private readonly IRecastBuilderProgressListener progressListener; private readonly IRecastBuilderProgressListener progressListener;
public RecastBuilder() public RecastBuilder()