From 0f16874d1459251491ce0ef269c115a508d91fc8 Mon Sep 17 00:00:00 2001 From: ikpil Date: Wed, 10 May 2023 22:44:51 +0900 Subject: [PATCH] change name --- src/DotRecast.Core/Intersections.cs | 2 +- .../{ArrayUtils.cs => RcArrayUtils.cs} | 2 +- .../{ByteBuffer.cs => RcByteBuffer.cs} | 24 ++++++------ .../{ByteOrder.cs => RcByteOrder.cs} | 2 +- .../{RecastMath.cs => RcMath.cs} | 2 +- .../{SortedQueue.cs => RcSortedQueue.cs} | 9 ++--- src/DotRecast.Detour.Crowd/Crowd.cs | 6 +-- src/DotRecast.Detour.Crowd/CrowdAgent.cs | 2 +- src/DotRecast.Detour.Crowd/LocalBoundary.cs | 2 +- .../ObstacleAvoidanceQuery.cs | 2 +- src/DotRecast.Detour.Crowd/PathCorridor.cs | 2 +- src/DotRecast.Detour.Crowd/PathQueue.cs | 2 +- .../Tracking/ObstacleAvoidanceDebugData.cs | 2 +- .../DynamicTileCheckpoint.cs | 2 +- src/DotRecast.Detour.Dynamic/Io/ByteUtils.cs | 16 ++++---- .../Io/LZ4VoxelTileCompressor.cs | 2 +- src/DotRecast.Detour.Dynamic/Io/VoxelFile.cs | 2 +- .../Io/VoxelFileReader.cs | 6 +-- .../Io/VoxelFileWriter.cs | 4 +- src/DotRecast.Detour.Dynamic/Io/VoxelTile.cs | 8 ++-- src/DotRecast.Detour.Extras/BVTreeBuilder.cs | 2 +- .../Jumplink/AbstractGroundSampler.cs | 2 +- .../Jumplink/EdgeSampler.cs | 2 +- .../Jumplink/JumpLinkBuilder.cs | 6 +-- .../Jumplink/JumpSegmentBuilder.cs | 2 +- .../Jumplink/TrajectorySampler.cs | 2 +- .../Unity/Astar/GraphConnectionReader.cs | 2 +- .../Unity/Astar/GraphMeshDataReader.cs | 2 +- .../Unity/Astar/NodeIndexReader.cs | 2 +- .../Unity/Astar/NodeLink2Reader.cs | 2 +- .../Unity/Astar/OffMeshLinkCreator.cs | 6 +-- .../Unity/Astar/ZipBinaryReader.cs | 6 +-- .../AbstractTileLayersBuilder.cs | 8 ++-- .../Io/Compress/FastLzTileCacheCompressor.cs | 2 +- .../Io/TileCacheLayerHeaderReader.cs | 2 +- .../Io/TileCacheLayerHeaderWriter.cs | 2 +- .../Io/TileCacheReader.cs | 8 ++-- .../Io/TileCacheWriter.cs | 4 +- src/DotRecast.Detour.TileCache/TileCache.cs | 4 +- .../TileCacheBuilder.cs | 10 ++--- .../TileCacheStorageParams.cs | 4 +- .../ConvexConvexIntersection.cs | 2 +- src/DotRecast.Detour/DefaultQueryFilter.cs | 2 +- src/DotRecast.Detour/DefaultQueryHeuristic.cs | 2 +- src/DotRecast.Detour/FindNearestPolyQuery.cs | 2 +- src/DotRecast.Detour/Io/DetourWriter.cs | 14 +++---- src/DotRecast.Detour/Io/IOUtils.cs | 8 ++-- src/DotRecast.Detour/Io/MeshDataReader.cs | 24 ++++++------ src/DotRecast.Detour/Io/MeshDataWriter.cs | 12 +++--- src/DotRecast.Detour/Io/MeshSetReader.cs | 16 ++++---- src/DotRecast.Detour/Io/MeshSetWriter.cs | 6 +-- src/DotRecast.Detour/Io/NavMeshParamReader.cs | 2 +- src/DotRecast.Detour/Io/NavMeshParamWriter.cs | 2 +- src/DotRecast.Detour/LegacyNavMeshQuery.cs | 2 +- src/DotRecast.Detour/NavMesh.cs | 2 +- src/DotRecast.Detour/NavMeshBuilder.cs | 2 +- src/DotRecast.Detour/NavMeshQuery.cs | 2 +- src/DotRecast.Detour/NodeQueue.cs | 2 +- src/DotRecast.Detour/StraightPathItem.cs | 2 +- .../StrictPolygonByCircleConstraint.cs | 2 +- .../Builder/TileNavMeshBuilder.cs | 2 +- src/DotRecast.Recast.Demo/Draw/DebugDraw.cs | 2 +- src/DotRecast.Recast.Demo/Draw/GLU.cs | 2 +- src/DotRecast.Recast.Demo/RecastDemo.cs | 2 +- .../Tools/ConvexVolumeTool.cs | 4 +- .../Tools/CrowdProfilingTool.cs | 4 +- src/DotRecast.Recast.Demo/Tools/CrowdTool.cs | 2 +- .../Tools/DynamicUpdateTool.cs | 2 +- .../Tools/Gizmos/CapsuleGizmo.cs | 2 +- .../Tools/Gizmos/CylinderGizmo.cs | 2 +- .../Tools/Gizmos/GizmoHelper.cs | 2 +- .../Tools/Gizmos/SphereGizmo.cs | 2 +- .../Tools/JumpLinkBuilderTool.cs | 2 +- .../Tools/OffMeshConnectionTool.cs | 2 +- .../Tools/TestNavmeshTool.cs | 8 ++-- src/DotRecast.Recast/RecastCompact.cs | 2 +- .../RecastFilledVolumeRasterization.cs | 8 ++-- src/DotRecast.Recast/RecastMeshDetail.cs | 2 +- src/DotRecast.Recast/RecastRasterization.cs | 2 +- .../AbstractCrowdTest.cs | 2 +- .../UnityAStarPathfindingImporterTest.cs | 2 +- .../Io/MeshDataReaderWriterTest.cs | 10 ++--- .../Io/MeshSetReaderWriterTest.cs | 4 +- test/DotRecast.Detour.Test/RandomPointTest.cs | 2 +- .../AbstractTileCacheTest.cs | 4 +- .../Io/TileCacheReaderWriterTest.cs | 6 +-- .../TempObstaclesTest.cs | 8 ++-- .../TestTileLayerBuilder.cs | 6 +-- .../TileCacheNavigationTest.cs | 4 +- .../TileCacheTest.cs | 38 +++++++++---------- 90 files changed, 212 insertions(+), 213 deletions(-) rename src/DotRecast.Core/{ArrayUtils.cs => RcArrayUtils.cs} (96%) rename src/DotRecast.Core/{ByteBuffer.cs => RcByteBuffer.cs} (81%) rename src/DotRecast.Core/{ByteOrder.cs => RcByteOrder.cs} (83%) rename src/DotRecast.Core/{RecastMath.cs => RcMath.cs} (99%) rename src/DotRecast.Core/{SortedQueue.cs => RcSortedQueue.cs} (94%) diff --git a/src/DotRecast.Core/Intersections.cs b/src/DotRecast.Core/Intersections.cs index dca9610..4d4024c 100644 --- a/src/DotRecast.Core/Intersections.cs +++ b/src/DotRecast.Core/Intersections.cs @@ -18,7 +18,7 @@ freely, subject to the following restrictions: using System; using DotRecast.Core; -using static DotRecast.Core.RecastMath; +using static DotRecast.Core.RcMath; namespace DotRecast.Core { diff --git a/src/DotRecast.Core/ArrayUtils.cs b/src/DotRecast.Core/RcArrayUtils.cs similarity index 96% rename from src/DotRecast.Core/ArrayUtils.cs rename to src/DotRecast.Core/RcArrayUtils.cs index 55f9c3a..b308de0 100644 --- a/src/DotRecast.Core/ArrayUtils.cs +++ b/src/DotRecast.Core/RcArrayUtils.cs @@ -2,7 +2,7 @@ namespace DotRecast.Core { - public static class ArrayUtils + public static class RcArrayUtils { public static T[] CopyOf(T[] source, int startIdx, int length) { diff --git a/src/DotRecast.Core/ByteBuffer.cs b/src/DotRecast.Core/RcByteBuffer.cs similarity index 81% rename from src/DotRecast.Core/ByteBuffer.cs rename to src/DotRecast.Core/RcByteBuffer.cs index 403bc40..fbfc3f6 100644 --- a/src/DotRecast.Core/ByteBuffer.cs +++ b/src/DotRecast.Core/RcByteBuffer.cs @@ -3,28 +3,28 @@ using System.Buffers.Binary; namespace DotRecast.Core { - public class ByteBuffer + public class RcByteBuffer { - private ByteOrder _order; + private RcByteOrder _order; private byte[] _bytes; private int _position; - public ByteBuffer(byte[] bytes) + public RcByteBuffer(byte[] bytes) { _order = BitConverter.IsLittleEndian - ? ByteOrder.LITTLE_ENDIAN - : ByteOrder.BIG_ENDIAN; + ? RcByteOrder.LITTLE_ENDIAN + : RcByteOrder.BIG_ENDIAN; _bytes = bytes; _position = 0; } - public ByteOrder Order() + public RcByteOrder Order() { return _order; } - public void Order(ByteOrder order) + public void Order(RcByteOrder order) { _order = order; } @@ -68,7 +68,7 @@ namespace DotRecast.Core public short GetShort() { var span = ReadBytes(2); - if (_order == ByteOrder.BIG_ENDIAN) + if (_order == RcByteOrder.BIG_ENDIAN) { return BinaryPrimitives.ReadInt16BigEndian(span); } @@ -82,7 +82,7 @@ namespace DotRecast.Core public int GetInt() { var span = ReadBytes(4); - if (_order == ByteOrder.BIG_ENDIAN) + if (_order == RcByteOrder.BIG_ENDIAN) { return BinaryPrimitives.ReadInt32BigEndian(span); } @@ -95,11 +95,11 @@ namespace DotRecast.Core public float GetFloat() { var span = ReadBytes(4); - if (_order == ByteOrder.BIG_ENDIAN && BitConverter.IsLittleEndian) + if (_order == RcByteOrder.BIG_ENDIAN && BitConverter.IsLittleEndian) { span.Reverse(); } - else if (_order == ByteOrder.LITTLE_ENDIAN && !BitConverter.IsLittleEndian) + else if (_order == RcByteOrder.LITTLE_ENDIAN && !BitConverter.IsLittleEndian) { span.Reverse(); } @@ -110,7 +110,7 @@ namespace DotRecast.Core public long GetLong() { var span = ReadBytes(8); - if (_order == ByteOrder.BIG_ENDIAN) + if (_order == RcByteOrder.BIG_ENDIAN) { return BinaryPrimitives.ReadInt64BigEndian(span); } diff --git a/src/DotRecast.Core/ByteOrder.cs b/src/DotRecast.Core/RcByteOrder.cs similarity index 83% rename from src/DotRecast.Core/ByteOrder.cs rename to src/DotRecast.Core/RcByteOrder.cs index badbe4a..0313a63 100644 --- a/src/DotRecast.Core/ByteOrder.cs +++ b/src/DotRecast.Core/RcByteOrder.cs @@ -1,6 +1,6 @@ namespace DotRecast.Core { - public enum ByteOrder + public enum RcByteOrder { /// Default on most Windows systems LITTLE_ENDIAN, diff --git a/src/DotRecast.Core/RecastMath.cs b/src/DotRecast.Core/RcMath.cs similarity index 99% rename from src/DotRecast.Core/RecastMath.cs rename to src/DotRecast.Core/RcMath.cs index a162577..76737d2 100644 --- a/src/DotRecast.Core/RecastMath.cs +++ b/src/DotRecast.Core/RcMath.cs @@ -23,7 +23,7 @@ using System.Numerics; namespace DotRecast.Core { - public static class RecastMath + public static class RcMath { public const float EPS = 1e-4f; private static readonly float EQUAL_THRESHOLD = Sqr(1.0f / 16384.0f); diff --git a/src/DotRecast.Core/SortedQueue.cs b/src/DotRecast.Core/RcSortedQueue.cs similarity index 94% rename from src/DotRecast.Core/SortedQueue.cs rename to src/DotRecast.Core/RcSortedQueue.cs index 4fffb7f..03c9960 100644 --- a/src/DotRecast.Core/SortedQueue.cs +++ b/src/DotRecast.Core/RcSortedQueue.cs @@ -19,18 +19,17 @@ freely, subject to the following restrictions: */ using System; +using System.Collections.Generic; namespace DotRecast.Core { - using System.Collections.Generic; - - public class SortedQueue + public class RcSortedQueue { private bool _dirty; private readonly List _items; private readonly Comparison _comparison; - public SortedQueue(Comparison comparison) + public RcSortedQueue(Comparison comparison) { _items = new List(); _comparison = (x, y) => comparison.Invoke(x, y) * -1; // reverse @@ -75,7 +74,7 @@ namespace DotRecast.Core int idx = _items.FindLastIndex(x => item.Equals(x)); if (0 > idx) return; - + _items.RemoveAt(idx); } diff --git a/src/DotRecast.Detour.Crowd/Crowd.cs b/src/DotRecast.Detour.Crowd/Crowd.cs index ee14e57..7ca3580 100644 --- a/src/DotRecast.Detour.Crowd/Crowd.cs +++ b/src/DotRecast.Detour.Crowd/Crowd.cs @@ -28,7 +28,7 @@ using DotRecast.Detour.QueryResults; namespace DotRecast.Detour.Crowd { - using static DotRecast.Core.RecastMath; + using static DotRecast.Core.RcMath; /** * Members in this module implement local steering and dynamic avoidance features. @@ -564,7 +564,7 @@ namespace DotRecast.Detour.Crowd { _telemetry.Start("updateMoveRequest"); - SortedQueue queue = new SortedQueue((a1, a2) => a2.targetReplanTime.CompareTo(a1.targetReplanTime)); + RcSortedQueue queue = new RcSortedQueue((a1, a2) => a2.targetReplanTime.CompareTo(a1.targetReplanTime)); // Fire off new requests. foreach (CrowdAgent ag in agents) @@ -824,7 +824,7 @@ namespace DotRecast.Detour.Crowd { _telemetry.Start("updateTopologyOptimization"); - SortedQueue queue = new SortedQueue((a1, a2) => a2.topologyOptTime.CompareTo(a1.topologyOptTime)); + RcSortedQueue queue = new RcSortedQueue((a1, a2) => a2.topologyOptTime.CompareTo(a1.topologyOptTime)); foreach (CrowdAgent ag in agents) { diff --git a/src/DotRecast.Detour.Crowd/CrowdAgent.cs b/src/DotRecast.Detour.Crowd/CrowdAgent.cs index 8badb02..6ada1c7 100644 --- a/src/DotRecast.Detour.Crowd/CrowdAgent.cs +++ b/src/DotRecast.Detour.Crowd/CrowdAgent.cs @@ -24,7 +24,7 @@ using DotRecast.Core; namespace DotRecast.Detour.Crowd { - using static DotRecast.Core.RecastMath; + using static DotRecast.Core.RcMath; /// Represents an agent managed by a #dtCrowd object. /// @ingroup crowd diff --git a/src/DotRecast.Detour.Crowd/LocalBoundary.cs b/src/DotRecast.Detour.Crowd/LocalBoundary.cs index 03cf691..4915672 100644 --- a/src/DotRecast.Detour.Crowd/LocalBoundary.cs +++ b/src/DotRecast.Detour.Crowd/LocalBoundary.cs @@ -25,7 +25,7 @@ using DotRecast.Detour.QueryResults; namespace DotRecast.Detour.Crowd { - using static DotRecast.Core.RecastMath; + using static DotRecast.Core.RcMath; public class LocalBoundary { diff --git a/src/DotRecast.Detour.Crowd/ObstacleAvoidanceQuery.cs b/src/DotRecast.Detour.Crowd/ObstacleAvoidanceQuery.cs index 3f853cc..e16307e 100644 --- a/src/DotRecast.Detour.Crowd/ObstacleAvoidanceQuery.cs +++ b/src/DotRecast.Detour.Crowd/ObstacleAvoidanceQuery.cs @@ -24,7 +24,7 @@ using DotRecast.Detour.Crowd.Tracking; namespace DotRecast.Detour.Crowd { - using static DotRecast.Core.RecastMath; + using static DotRecast.Core.RcMath; public class ObstacleAvoidanceQuery { diff --git a/src/DotRecast.Detour.Crowd/PathCorridor.cs b/src/DotRecast.Detour.Crowd/PathCorridor.cs index 3bafc07..d1f3aa4 100644 --- a/src/DotRecast.Detour.Crowd/PathCorridor.cs +++ b/src/DotRecast.Detour.Crowd/PathCorridor.cs @@ -25,7 +25,7 @@ using DotRecast.Detour.QueryResults; namespace DotRecast.Detour.Crowd { - using static DotRecast.Core.RecastMath; + using static DotRecast.Core.RcMath; /** * Represents a dynamic polygon corridor used to plan agent movement. diff --git a/src/DotRecast.Detour.Crowd/PathQueue.cs b/src/DotRecast.Detour.Crowd/PathQueue.cs index 5bb2f6c..feaca5f 100644 --- a/src/DotRecast.Detour.Crowd/PathQueue.cs +++ b/src/DotRecast.Detour.Crowd/PathQueue.cs @@ -24,7 +24,7 @@ using DotRecast.Detour.QueryResults; namespace DotRecast.Detour.Crowd { - using static DotRecast.Core.RecastMath; + using static DotRecast.Core.RcMath; public class PathQueue { diff --git a/src/DotRecast.Detour.Crowd/Tracking/ObstacleAvoidanceDebugData.cs b/src/DotRecast.Detour.Crowd/Tracking/ObstacleAvoidanceDebugData.cs index fb4e959..af2e9ac 100644 --- a/src/DotRecast.Detour.Crowd/Tracking/ObstacleAvoidanceDebugData.cs +++ b/src/DotRecast.Detour.Crowd/Tracking/ObstacleAvoidanceDebugData.cs @@ -23,7 +23,7 @@ using DotRecast.Core; namespace DotRecast.Detour.Crowd.Tracking { - using static DotRecast.Core.RecastMath; + using static DotRecast.Core.RcMath; public class ObstacleAvoidanceDebugData { diff --git a/src/DotRecast.Detour.Dynamic/DynamicTileCheckpoint.cs b/src/DotRecast.Detour.Dynamic/DynamicTileCheckpoint.cs index 7c77c12..07769f9 100644 --- a/src/DotRecast.Detour.Dynamic/DynamicTileCheckpoint.cs +++ b/src/DotRecast.Detour.Dynamic/DynamicTileCheckpoint.cs @@ -18,7 +18,7 @@ freely, subject to the following restrictions: using System.Collections.Generic; using DotRecast.Recast; -using static DotRecast.Core.RecastMath; +using static DotRecast.Core.RcMath; namespace DotRecast.Detour.Dynamic { diff --git a/src/DotRecast.Detour.Dynamic/Io/ByteUtils.cs b/src/DotRecast.Detour.Dynamic/Io/ByteUtils.cs index a85e808..8e90aff 100644 --- a/src/DotRecast.Detour.Dynamic/Io/ByteUtils.cs +++ b/src/DotRecast.Detour.Dynamic/Io/ByteUtils.cs @@ -22,9 +22,9 @@ namespace DotRecast.Detour.Dynamic.Io { public static class ByteUtils { - public static int GetInt(byte[] data, int position, ByteOrder order) + public static int GetInt(byte[] data, int position, RcByteOrder order) { - return order == ByteOrder.BIG_ENDIAN ? GetIntBE(data, position) : GetIntLE(data, position); + return order == RcByteOrder.BIG_ENDIAN ? GetIntBE(data, position) : GetIntLE(data, position); } public static int GetIntBE(byte[] data, int position) @@ -39,9 +39,9 @@ namespace DotRecast.Detour.Dynamic.Io | (data[position] & 0xff); } - public static int GetShort(byte[] data, int position, ByteOrder order) + public static int GetShort(byte[] data, int position, RcByteOrder order) { - return order == ByteOrder.BIG_ENDIAN ? GetShortBE(data, position) : GetShortLE(data, position); + return order == RcByteOrder.BIG_ENDIAN ? GetShortBE(data, position) : GetShortLE(data, position); } public static int GetShortBE(byte[] data, int position) @@ -54,9 +54,9 @@ namespace DotRecast.Detour.Dynamic.Io return ((data[position + 1] & 0xff) << 8) | (data[position] & 0xff); } - public static int PutInt(int value, byte[] data, int position, ByteOrder order) + public static int PutInt(int value, byte[] data, int position, RcByteOrder order) { - if (order == ByteOrder.BIG_ENDIAN) + if (order == RcByteOrder.BIG_ENDIAN) { data[position] = (byte)((uint)value >> 24); data[position + 1] = (byte)((uint)value >> 16); @@ -74,9 +74,9 @@ namespace DotRecast.Detour.Dynamic.Io return position + 4; } - public static int PutShort(int value, byte[] data, int position, ByteOrder order) + public static int PutShort(int value, byte[] data, int position, RcByteOrder order) { - if (order == ByteOrder.BIG_ENDIAN) + if (order == RcByteOrder.BIG_ENDIAN) { data[position] = (byte)((uint)value >> 8); data[position + 1] = (byte)(value & 0xFF); diff --git a/src/DotRecast.Detour.Dynamic/Io/LZ4VoxelTileCompressor.cs b/src/DotRecast.Detour.Dynamic/Io/LZ4VoxelTileCompressor.cs index a29c4ee..0cd7f0e 100644 --- a/src/DotRecast.Detour.Dynamic/Io/LZ4VoxelTileCompressor.cs +++ b/src/DotRecast.Detour.Dynamic/Io/LZ4VoxelTileCompressor.cs @@ -34,7 +34,7 @@ namespace DotRecast.Detour.Dynamic.Io { byte[] compressed = LZ4Pickler.Pickle(data, LZ4Level.L12_MAX); byte[] result = new byte[4 + compressed.Length]; - ByteUtils.PutInt(compressed.Length, result, 0, ByteOrder.BIG_ENDIAN); + ByteUtils.PutInt(compressed.Length, result, 0, RcByteOrder.BIG_ENDIAN); Array.Copy(compressed, 0, result, 4, compressed.Length); return result; } diff --git a/src/DotRecast.Detour.Dynamic/Io/VoxelFile.cs b/src/DotRecast.Detour.Dynamic/Io/VoxelFile.cs index 46b214b..f8929b7 100644 --- a/src/DotRecast.Detour.Dynamic/Io/VoxelFile.cs +++ b/src/DotRecast.Detour.Dynamic/Io/VoxelFile.cs @@ -25,7 +25,7 @@ namespace DotRecast.Detour.Dynamic.Io { public class VoxelFile { - public static readonly ByteOrder PREFERRED_BYTE_ORDER = ByteOrder.BIG_ENDIAN; + public static readonly RcByteOrder PREFERRED_BYTE_ORDER = RcByteOrder.BIG_ENDIAN; public const int MAGIC = 'V' << 24 | 'O' << 16 | 'X' << 8 | 'L'; public const int VERSION_EXPORTER_MASK = 0xF000; public const int VERSION_COMPRESSION_MASK = 0x0F00; diff --git a/src/DotRecast.Detour.Dynamic/Io/VoxelFileReader.cs b/src/DotRecast.Detour.Dynamic/Io/VoxelFileReader.cs index ab15865..fd81f85 100644 --- a/src/DotRecast.Detour.Dynamic/Io/VoxelFileReader.cs +++ b/src/DotRecast.Detour.Dynamic/Io/VoxelFileReader.cs @@ -28,7 +28,7 @@ namespace DotRecast.Detour.Dynamic.Io public VoxelFile Read(BinaryReader stream) { - ByteBuffer buf = IOUtils.ToByteBuffer(stream); + RcByteBuffer buf = IOUtils.ToByteBuffer(stream); VoxelFile file = new VoxelFile(); int magic = buf.GetInt(); if (magic != VoxelFile.MAGIC) @@ -39,7 +39,7 @@ namespace DotRecast.Detour.Dynamic.Io throw new IOException("Invalid magic"); } - buf.Order(buf.Order() == ByteOrder.BIG_ENDIAN ? ByteOrder.LITTLE_ENDIAN : ByteOrder.BIG_ENDIAN); + buf.Order(buf.Order() == RcByteOrder.BIG_ENDIAN ? RcByteOrder.LITTLE_ENDIAN : RcByteOrder.BIG_ENDIAN); } file.version = buf.GetInt(); @@ -130,7 +130,7 @@ namespace DotRecast.Detour.Dynamic.Io bytes = compressor.Decompress(bytes); } - ByteBuffer data = new ByteBuffer(bytes); + RcByteBuffer data = new RcByteBuffer(bytes); data.Order(buf.Order()); file.AddTile(new VoxelTile(tileX, tileZ, width, depth, boundsMin, boundsMax, cellSize, cellHeight, borderSize, data)); buf.Position(position + voxelSize); diff --git a/src/DotRecast.Detour.Dynamic/Io/VoxelFileWriter.cs b/src/DotRecast.Detour.Dynamic/Io/VoxelFileWriter.cs index af38577..38f18c8 100644 --- a/src/DotRecast.Detour.Dynamic/Io/VoxelFileWriter.cs +++ b/src/DotRecast.Detour.Dynamic/Io/VoxelFileWriter.cs @@ -31,7 +31,7 @@ namespace DotRecast.Detour.Dynamic.Io Write(stream, f, VoxelFile.PREFERRED_BYTE_ORDER, compression); } - public void Write(BinaryWriter stream, VoxelFile f, ByteOrder byteOrder, bool compression) + public void Write(BinaryWriter stream, VoxelFile f, RcByteOrder byteOrder, bool compression) { Write(stream, VoxelFile.MAGIC, byteOrder); Write(stream, VoxelFile.VERSION_EXPORTER_RECAST4J | (compression ? VoxelFile.VERSION_COMPRESSION_LZ4 : 0), byteOrder); @@ -67,7 +67,7 @@ namespace DotRecast.Detour.Dynamic.Io } } - public void WriteTile(BinaryWriter stream, VoxelTile tile, ByteOrder byteOrder, bool compression) + public void WriteTile(BinaryWriter stream, VoxelTile tile, RcByteOrder byteOrder, bool compression) { Write(stream, tile.tileX, byteOrder); Write(stream, tile.tileZ, byteOrder); diff --git a/src/DotRecast.Detour.Dynamic/Io/VoxelTile.cs b/src/DotRecast.Detour.Dynamic/Io/VoxelTile.cs index 00e99cf..ac75806 100644 --- a/src/DotRecast.Detour.Dynamic/Io/VoxelTile.cs +++ b/src/DotRecast.Detour.Dynamic/Io/VoxelTile.cs @@ -37,7 +37,7 @@ namespace DotRecast.Detour.Dynamic.Io public readonly byte[] spanData; public VoxelTile(int tileX, int tileZ, int width, int depth, Vector3f boundsMin, Vector3f boundsMax, float cellSize, - float cellHeight, int borderSize, ByteBuffer buffer) + float cellHeight, int borderSize, RcByteBuffer buffer) { this.tileX = tileX; this.tileZ = tileZ; @@ -67,7 +67,7 @@ namespace DotRecast.Detour.Dynamic.Io public Heightfield Heightfield() { - return VoxelFile.PREFERRED_BYTE_ORDER == ByteOrder.BIG_ENDIAN ? HeightfieldBE() : HeightfieldLE(); + return VoxelFile.PREFERRED_BYTE_ORDER == RcByteOrder.BIG_ENDIAN ? HeightfieldBE() : HeightfieldLE(); } private Heightfield HeightfieldBE() @@ -144,7 +144,7 @@ namespace DotRecast.Detour.Dynamic.Io return hf; } - private byte[] SerializeSpans(Heightfield heightfield, ByteOrder order) + private byte[] SerializeSpans(Heightfield heightfield, RcByteOrder order) { int[] counts = new int[heightfield.width * heightfield.height]; int totalCount = 0; @@ -183,7 +183,7 @@ namespace DotRecast.Detour.Dynamic.Io return data; } - private byte[] ToByteArray(ByteBuffer buf, int width, int height, ByteOrder order) + private byte[] ToByteArray(RcByteBuffer buf, int width, int height, RcByteOrder order) { byte[] data; if (buf.Order() == order) diff --git a/src/DotRecast.Detour.Extras/BVTreeBuilder.cs b/src/DotRecast.Detour.Extras/BVTreeBuilder.cs index 9659d1c..a56486d 100644 --- a/src/DotRecast.Detour.Extras/BVTreeBuilder.cs +++ b/src/DotRecast.Detour.Extras/BVTreeBuilder.cs @@ -17,7 +17,7 @@ freely, subject to the following restrictions: */ using DotRecast.Core; -using static DotRecast.Core.RecastMath; +using static DotRecast.Core.RcMath; namespace DotRecast.Detour.Extras { diff --git a/src/DotRecast.Detour.Extras/Jumplink/AbstractGroundSampler.cs b/src/DotRecast.Detour.Extras/Jumplink/AbstractGroundSampler.cs index ab358ac..e995360 100644 --- a/src/DotRecast.Detour.Extras/Jumplink/AbstractGroundSampler.cs +++ b/src/DotRecast.Detour.Extras/Jumplink/AbstractGroundSampler.cs @@ -1,7 +1,7 @@ using System; using DotRecast.Core; using DotRecast.Recast; -using static DotRecast.Core.RecastMath; +using static DotRecast.Core.RcMath; namespace DotRecast.Detour.Extras.Jumplink { diff --git a/src/DotRecast.Detour.Extras/Jumplink/EdgeSampler.cs b/src/DotRecast.Detour.Extras/Jumplink/EdgeSampler.cs index 09a215c..d9f0ef9 100644 --- a/src/DotRecast.Detour.Extras/Jumplink/EdgeSampler.cs +++ b/src/DotRecast.Detour.Extras/Jumplink/EdgeSampler.cs @@ -1,6 +1,6 @@ using System.Collections.Generic; using DotRecast.Core; -using static DotRecast.Core.RecastMath; +using static DotRecast.Core.RcMath; namespace DotRecast.Detour.Extras.Jumplink { diff --git a/src/DotRecast.Detour.Extras/Jumplink/JumpLinkBuilder.cs b/src/DotRecast.Detour.Extras/Jumplink/JumpLinkBuilder.cs index a97355a..e70cfc8 100644 --- a/src/DotRecast.Detour.Extras/Jumplink/JumpLinkBuilder.cs +++ b/src/DotRecast.Detour.Extras/Jumplink/JumpLinkBuilder.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; using System.Linq; using DotRecast.Core; using DotRecast.Recast; -using static DotRecast.Core.RecastMath; +using static DotRecast.Core.RcMath; namespace DotRecast.Detour.Extras.Jumplink { @@ -64,8 +64,8 @@ namespace DotRecast.Detour.Extras.Jumplink { JumpLink link = new JumpLink(); links.Add(link); - link.startSamples = ArrayUtils.CopyOf(es.start.gsamples, js.startSample, js.samples); - link.endSamples = ArrayUtils.CopyOf(end.gsamples, js.startSample, js.samples); + link.startSamples = RcArrayUtils.CopyOf(es.start.gsamples, js.startSample, js.samples); + link.endSamples = RcArrayUtils.CopyOf(end.gsamples, js.startSample, js.samples); link.start = es.start; link.end = end; link.trajectory = es.trajectory; diff --git a/src/DotRecast.Detour.Extras/Jumplink/JumpSegmentBuilder.cs b/src/DotRecast.Detour.Extras/Jumplink/JumpSegmentBuilder.cs index 42632d1..484ee6d 100644 --- a/src/DotRecast.Detour.Extras/Jumplink/JumpSegmentBuilder.cs +++ b/src/DotRecast.Detour.Extras/Jumplink/JumpSegmentBuilder.cs @@ -9,7 +9,7 @@ namespace DotRecast.Detour.Extras.Jumplink public JumpSegment[] Build(JumpLinkBuilderConfig acfg, EdgeSampler es) { int n = es.end[0].gsamples.Length; - int[][] sampleGrid = ArrayUtils.Of(n, es.end.Count); + int[][] sampleGrid = RcArrayUtils.Of(n, es.end.Count); for (int j = 0; j < es.end.Count; j++) { for (int i = 0; i < n; i++) diff --git a/src/DotRecast.Detour.Extras/Jumplink/TrajectorySampler.cs b/src/DotRecast.Detour.Extras/Jumplink/TrajectorySampler.cs index 8738fb6..9b2cedf 100644 --- a/src/DotRecast.Detour.Extras/Jumplink/TrajectorySampler.cs +++ b/src/DotRecast.Detour.Extras/Jumplink/TrajectorySampler.cs @@ -1,7 +1,7 @@ using System; using DotRecast.Core; using DotRecast.Recast; -using static DotRecast.Core.RecastMath; +using static DotRecast.Core.RcMath; namespace DotRecast.Detour.Extras.Jumplink { diff --git a/src/DotRecast.Detour.Extras/Unity/Astar/GraphConnectionReader.cs b/src/DotRecast.Detour.Extras/Unity/Astar/GraphConnectionReader.cs index f2202ca..1742382 100644 --- a/src/DotRecast.Detour.Extras/Unity/Astar/GraphConnectionReader.cs +++ b/src/DotRecast.Detour.Extras/Unity/Astar/GraphConnectionReader.cs @@ -27,7 +27,7 @@ namespace DotRecast.Detour.Extras.Unity.Astar public List Read(ZipArchive file, string filename, Meta meta, int[] indexToNode) { List connections = new List(); - ByteBuffer buffer = ToByteBuffer(file, filename); + RcByteBuffer buffer = ToByteBuffer(file, filename); while (buffer.Remaining() > 0) { int count = buffer.GetInt(); diff --git a/src/DotRecast.Detour.Extras/Unity/Astar/GraphMeshDataReader.cs b/src/DotRecast.Detour.Extras/Unity/Astar/GraphMeshDataReader.cs index a95482f..389e096 100644 --- a/src/DotRecast.Detour.Extras/Unity/Astar/GraphMeshDataReader.cs +++ b/src/DotRecast.Detour.Extras/Unity/Astar/GraphMeshDataReader.cs @@ -29,7 +29,7 @@ namespace DotRecast.Detour.Extras.Unity.Astar public GraphMeshData Read(ZipArchive file, string filename, GraphMeta meta, int maxVertPerPoly) { - ByteBuffer buffer = ToByteBuffer(file, filename); + RcByteBuffer buffer = ToByteBuffer(file, filename); int tileXCount = buffer.GetInt(); if (tileXCount < 0) { diff --git a/src/DotRecast.Detour.Extras/Unity/Astar/NodeIndexReader.cs b/src/DotRecast.Detour.Extras/Unity/Astar/NodeIndexReader.cs index 7151746..544bf9d 100644 --- a/src/DotRecast.Detour.Extras/Unity/Astar/NodeIndexReader.cs +++ b/src/DotRecast.Detour.Extras/Unity/Astar/NodeIndexReader.cs @@ -25,7 +25,7 @@ namespace DotRecast.Detour.Extras.Unity.Astar { public int[] Read(ZipArchive file, string filename) { - ByteBuffer buffer = ToByteBuffer(file, filename); + RcByteBuffer buffer = ToByteBuffer(file, filename); int maxNodeIndex = buffer.GetInt(); int[] int2Node = new int[maxNodeIndex + 1]; int node = 0; diff --git a/src/DotRecast.Detour.Extras/Unity/Astar/NodeLink2Reader.cs b/src/DotRecast.Detour.Extras/Unity/Astar/NodeLink2Reader.cs index f6d1337..626fa3e 100644 --- a/src/DotRecast.Detour.Extras/Unity/Astar/NodeLink2Reader.cs +++ b/src/DotRecast.Detour.Extras/Unity/Astar/NodeLink2Reader.cs @@ -25,7 +25,7 @@ namespace DotRecast.Detour.Extras.Unity.Astar { public NodeLink2[] Read(ZipArchive file, string filename, int[] indexToNode) { - ByteBuffer buffer = ToByteBuffer(file, filename); + RcByteBuffer buffer = ToByteBuffer(file, filename); int linkCount = buffer.GetInt(); NodeLink2[] links = new NodeLink2[linkCount]; for (int i = 0; i < linkCount; i++) diff --git a/src/DotRecast.Detour.Extras/Unity/Astar/OffMeshLinkCreator.cs b/src/DotRecast.Detour.Extras/Unity/Astar/OffMeshLinkCreator.cs index 9266d23..a1497ea 100644 --- a/src/DotRecast.Detour.Extras/Unity/Astar/OffMeshLinkCreator.cs +++ b/src/DotRecast.Detour.Extras/Unity/Astar/OffMeshLinkCreator.cs @@ -35,13 +35,13 @@ namespace DotRecast.Detour.Extras.Unity.Astar if (startNode != null && endNode != null) { // FIXME: Optimise - startTile.polys = ArrayUtils.CopyOf(startTile.polys, startTile.polys.Length + 1); + startTile.polys = RcArrayUtils.CopyOf(startTile.polys, startTile.polys.Length + 1); int poly = startTile.header.polyCount; startTile.polys[poly] = new Poly(poly, 2); startTile.polys[poly].verts[0] = startTile.header.vertCount; startTile.polys[poly].verts[1] = startTile.header.vertCount + 1; startTile.polys[poly].SetType(Poly.DT_POLYTYPE_OFFMESH_CONNECTION); - startTile.verts = ArrayUtils.CopyOf(startTile.verts, startTile.verts.Length + 6); + startTile.verts = RcArrayUtils.CopyOf(startTile.verts, startTile.verts.Length + 6); startTile.header.polyCount++; startTile.header.vertCount += 2; OffMeshConnection connection = new OffMeshConnection(); @@ -63,7 +63,7 @@ namespace DotRecast.Detour.Extras.Unity.Astar } else { - startTile.offMeshCons = ArrayUtils.CopyOf(startTile.offMeshCons, startTile.offMeshCons.Length + 1); + startTile.offMeshCons = RcArrayUtils.CopyOf(startTile.offMeshCons, startTile.offMeshCons.Length + 1); } startTile.offMeshCons[startTile.offMeshCons.Length - 1] = connection; diff --git a/src/DotRecast.Detour.Extras/Unity/Astar/ZipBinaryReader.cs b/src/DotRecast.Detour.Extras/Unity/Astar/ZipBinaryReader.cs index 6814629..8149235 100644 --- a/src/DotRecast.Detour.Extras/Unity/Astar/ZipBinaryReader.cs +++ b/src/DotRecast.Detour.Extras/Unity/Astar/ZipBinaryReader.cs @@ -25,13 +25,13 @@ namespace DotRecast.Detour.Extras.Unity.Astar { public abstract class ZipBinaryReader { - protected ByteBuffer ToByteBuffer(ZipArchive file, string filename) + protected RcByteBuffer ToByteBuffer(ZipArchive file, string filename) { ZipArchiveEntry graphReferences = file.GetEntry(filename); using var entryStream = graphReferences.Open(); using var bis = new BinaryReader(entryStream); - ByteBuffer buffer = IOUtils.ToByteBuffer(bis); - buffer.Order(ByteOrder.LITTLE_ENDIAN); + RcByteBuffer buffer = IOUtils.ToByteBuffer(bis); + buffer.Order(RcByteOrder.LITTLE_ENDIAN); return buffer; } } diff --git a/src/DotRecast.Detour.TileCache/AbstractTileLayersBuilder.cs b/src/DotRecast.Detour.TileCache/AbstractTileLayersBuilder.cs index 23bd2dd..697e85d 100644 --- a/src/DotRecast.Detour.TileCache/AbstractTileLayersBuilder.cs +++ b/src/DotRecast.Detour.TileCache/AbstractTileLayersBuilder.cs @@ -29,7 +29,7 @@ namespace DotRecast.Detour.TileCache { public abstract class AbstractTileLayersBuilder { - protected List Build(ByteOrder order, bool cCompatibility, int threads, int tw, int th) + protected List Build(RcByteOrder order, bool cCompatibility, int threads, int tw, int th) { if (threads == 1) { @@ -39,7 +39,7 @@ namespace DotRecast.Detour.TileCache return BuildMultiThread(order, cCompatibility, tw, th, threads); } - private List BuildSingleThread(ByteOrder order, bool cCompatibility, int tw, int th) + private List BuildSingleThread(RcByteOrder order, bool cCompatibility, int tw, int th) { List layers = new List(); for (int y = 0; y < th; ++y) @@ -53,7 +53,7 @@ namespace DotRecast.Detour.TileCache return layers; } - private List BuildMultiThread(ByteOrder order, bool cCompatibility, int tw, int th, int threads) + private List BuildMultiThread(RcByteOrder order, bool cCompatibility, int tw, int th, int threads) { var tasks = new ConcurrentQueue>>>(); for (int y = 0; y < th; ++y) @@ -88,6 +88,6 @@ namespace DotRecast.Detour.TileCache return layers; } - protected abstract List Build(int tx, int ty, ByteOrder order, bool cCompatibility); + protected abstract List Build(int tx, int ty, RcByteOrder order, bool cCompatibility); } } \ No newline at end of file diff --git a/src/DotRecast.Detour.TileCache/Io/Compress/FastLzTileCacheCompressor.cs b/src/DotRecast.Detour.TileCache/Io/Compress/FastLzTileCacheCompressor.cs index 8192226..c14624f 100644 --- a/src/DotRecast.Detour.TileCache/Io/Compress/FastLzTileCacheCompressor.cs +++ b/src/DotRecast.Detour.TileCache/Io/Compress/FastLzTileCacheCompressor.cs @@ -35,7 +35,7 @@ namespace DotRecast.Detour.TileCache.Io.Compress { byte[] output = new byte[FastLz.CalculateOutputBufferLength(buf.Length)]; int len = FastLz.Compress(buf, 0, buf.Length, output, 0, output.Length); - return ArrayUtils.CopyOf(output, len); + return RcArrayUtils.CopyOf(output, len); } } } \ No newline at end of file diff --git a/src/DotRecast.Detour.TileCache/Io/TileCacheLayerHeaderReader.cs b/src/DotRecast.Detour.TileCache/Io/TileCacheLayerHeaderReader.cs index d9cccfd..adc9203 100644 --- a/src/DotRecast.Detour.TileCache/Io/TileCacheLayerHeaderReader.cs +++ b/src/DotRecast.Detour.TileCache/Io/TileCacheLayerHeaderReader.cs @@ -25,7 +25,7 @@ namespace DotRecast.Detour.TileCache.Io { public class TileCacheLayerHeaderReader { - public TileCacheLayerHeader Read(ByteBuffer data, bool cCompatibility) + public TileCacheLayerHeader Read(RcByteBuffer data, bool cCompatibility) { TileCacheLayerHeader header = new TileCacheLayerHeader(); header.magic = data.GetInt(); diff --git a/src/DotRecast.Detour.TileCache/Io/TileCacheLayerHeaderWriter.cs b/src/DotRecast.Detour.TileCache/Io/TileCacheLayerHeaderWriter.cs index dc9c513..9eb51ce 100644 --- a/src/DotRecast.Detour.TileCache/Io/TileCacheLayerHeaderWriter.cs +++ b/src/DotRecast.Detour.TileCache/Io/TileCacheLayerHeaderWriter.cs @@ -26,7 +26,7 @@ namespace DotRecast.Detour.TileCache.Io { public class TileCacheLayerHeaderWriter : DetourWriter { - public void Write(BinaryWriter stream, TileCacheLayerHeader header, ByteOrder order, bool cCompatibility) + public void Write(BinaryWriter stream, TileCacheLayerHeader header, RcByteOrder order, bool cCompatibility) { Write(stream, header.magic, order); Write(stream, header.version, order); diff --git a/src/DotRecast.Detour.TileCache/Io/TileCacheReader.cs b/src/DotRecast.Detour.TileCache/Io/TileCacheReader.cs index eec4c80..5d165f9 100644 --- a/src/DotRecast.Detour.TileCache/Io/TileCacheReader.cs +++ b/src/DotRecast.Detour.TileCache/Io/TileCacheReader.cs @@ -31,11 +31,11 @@ namespace DotRecast.Detour.TileCache.Io public TileCache Read(BinaryReader @is, int maxVertPerPoly, ITileCacheMeshProcess meshProcessor) { - ByteBuffer bb = IOUtils.ToByteBuffer(@is); + RcByteBuffer bb = IOUtils.ToByteBuffer(@is); return Read(bb, maxVertPerPoly, meshProcessor); } - public TileCache Read(ByteBuffer bb, int maxVertPerPoly, ITileCacheMeshProcess meshProcessor) + public TileCache Read(RcByteBuffer bb, int maxVertPerPoly, ITileCacheMeshProcess meshProcessor) { TileCacheSetHeader header = new TileCacheSetHeader(); header.magic = bb.GetInt(); @@ -47,7 +47,7 @@ namespace DotRecast.Detour.TileCache.Io throw new IOException("Invalid magic"); } - bb.Order(bb.Order() == ByteOrder.BIG_ENDIAN ? ByteOrder.LITTLE_ENDIAN : ByteOrder.BIG_ENDIAN); + bb.Order(bb.Order() == RcByteOrder.BIG_ENDIAN ? RcByteOrder.LITTLE_ENDIAN : RcByteOrder.BIG_ENDIAN); } header.version = bb.GetInt(); @@ -88,7 +88,7 @@ namespace DotRecast.Detour.TileCache.Io return tc; } - private TileCacheParams ReadCacheParams(ByteBuffer bb, bool cCompatibility) + private TileCacheParams ReadCacheParams(RcByteBuffer bb, bool cCompatibility) { TileCacheParams option = new TileCacheParams(); diff --git a/src/DotRecast.Detour.TileCache/Io/TileCacheWriter.cs b/src/DotRecast.Detour.TileCache/Io/TileCacheWriter.cs index f4a6b3c..385e98b 100644 --- a/src/DotRecast.Detour.TileCache/Io/TileCacheWriter.cs +++ b/src/DotRecast.Detour.TileCache/Io/TileCacheWriter.cs @@ -29,7 +29,7 @@ namespace DotRecast.Detour.TileCache.Io private readonly NavMeshParamWriter paramWriter = new NavMeshParamWriter(); private readonly TileCacheBuilder builder = new TileCacheBuilder(); - public void Write(BinaryWriter stream, TileCache cache, ByteOrder order, bool cCompatibility) + public void Write(BinaryWriter stream, TileCache cache, RcByteOrder order, bool cCompatibility) { Write(stream, TileCacheSetHeader.TILECACHESET_MAGIC, order); Write(stream, cCompatibility @@ -61,7 +61,7 @@ namespace DotRecast.Detour.TileCache.Io } } - private void WriteCacheParams(BinaryWriter stream, TileCacheParams option, ByteOrder order) + private void WriteCacheParams(BinaryWriter stream, TileCacheParams option, RcByteOrder order) { Write(stream, option.orig.x, order); Write(stream, option.orig.y, order); diff --git a/src/DotRecast.Detour.TileCache/TileCache.cs b/src/DotRecast.Detour.TileCache/TileCache.cs index 2bfe8fc..4ce8e8c 100644 --- a/src/DotRecast.Detour.TileCache/TileCache.cs +++ b/src/DotRecast.Detour.TileCache/TileCache.cs @@ -22,7 +22,7 @@ using System; using System.Collections.Generic; using DotRecast.Core; using DotRecast.Detour.TileCache.Io; -using static DotRecast.Core.RecastMath; +using static DotRecast.Core.RcMath; namespace DotRecast.Detour.TileCache { @@ -253,7 +253,7 @@ namespace DotRecast.Detour.TileCache public long AddTile(byte[] data, int flags) { // Make sure the data is in right format. - ByteBuffer buf = new ByteBuffer(data); + RcByteBuffer buf = new RcByteBuffer(data); buf.Order(m_storageParams.byteOrder); TileCacheLayerHeader header = tileReader.Read(buf, m_storageParams.cCompatibility); // Make sure the location is free. diff --git a/src/DotRecast.Detour.TileCache/TileCacheBuilder.cs b/src/DotRecast.Detour.TileCache/TileCacheBuilder.cs index 688ed48..a330f53 100644 --- a/src/DotRecast.Detour.TileCache/TileCacheBuilder.cs +++ b/src/DotRecast.Detour.TileCache/TileCacheBuilder.cs @@ -24,7 +24,7 @@ using System.IO; using DotRecast.Core; using DotRecast.Detour.TileCache.Io; using DotRecast.Detour.TileCache.Io.Compress; -using static DotRecast.Core.RecastMath; +using static DotRecast.Core.RcMath; namespace DotRecast.Detour.TileCache { @@ -1915,7 +1915,7 @@ namespace DotRecast.Detour.TileCache } } - public byte[] CompressTileCacheLayer(TileCacheLayer layer, ByteOrder order, bool cCompatibility) + public byte[] CompressTileCacheLayer(TileCacheLayer layer, RcByteOrder order, bool cCompatibility) { using var ms = new MemoryStream(); using var baos = new BinaryWriter(ms); @@ -1942,7 +1942,7 @@ namespace DotRecast.Detour.TileCache } public byte[] CompressTileCacheLayer(TileCacheLayerHeader header, int[] heights, int[] areas, int[] cons, - ByteOrder order, bool cCompatibility) + RcByteOrder order, bool cCompatibility) { using var ms = new MemoryStream(); using var baos = new BinaryWriter(ms); @@ -1968,10 +1968,10 @@ namespace DotRecast.Detour.TileCache } } - public TileCacheLayer DecompressTileCacheLayer(ITileCacheCompressor comp, byte[] compressed, ByteOrder order, + public TileCacheLayer DecompressTileCacheLayer(ITileCacheCompressor comp, byte[] compressed, RcByteOrder order, bool cCompatibility) { - ByteBuffer buf = new ByteBuffer(compressed); + RcByteBuffer buf = new RcByteBuffer(compressed); buf.Order(order); TileCacheLayer layer = new TileCacheLayer(); try diff --git a/src/DotRecast.Detour.TileCache/TileCacheStorageParams.cs b/src/DotRecast.Detour.TileCache/TileCacheStorageParams.cs index 2d00960..77ce2bf 100644 --- a/src/DotRecast.Detour.TileCache/TileCacheStorageParams.cs +++ b/src/DotRecast.Detour.TileCache/TileCacheStorageParams.cs @@ -24,10 +24,10 @@ namespace DotRecast.Detour.TileCache { public class TileCacheStorageParams { - public readonly ByteOrder byteOrder; + public readonly RcByteOrder byteOrder; public readonly bool cCompatibility; - public TileCacheStorageParams(ByteOrder byteOrder, bool cCompatibility) + public TileCacheStorageParams(RcByteOrder byteOrder, bool cCompatibility) { this.byteOrder = byteOrder; this.cCompatibility = cCompatibility; diff --git a/src/DotRecast.Detour/ConvexConvexIntersection.cs b/src/DotRecast.Detour/ConvexConvexIntersection.cs index 2a766d9..a693ccb 100644 --- a/src/DotRecast.Detour/ConvexConvexIntersection.cs +++ b/src/DotRecast.Detour/ConvexConvexIntersection.cs @@ -21,7 +21,7 @@ using DotRecast.Core; namespace DotRecast.Detour { - using static DotRecast.Core.RecastMath; + using static DotRecast.Core.RcMath; /** * Convex-convex intersection based on "Computational Geometry in C" by Joseph O'Rourke diff --git a/src/DotRecast.Detour/DefaultQueryFilter.cs b/src/DotRecast.Detour/DefaultQueryFilter.cs index 079e93e..c390a10 100644 --- a/src/DotRecast.Detour/DefaultQueryFilter.cs +++ b/src/DotRecast.Detour/DefaultQueryFilter.cs @@ -23,7 +23,7 @@ using DotRecast.Core; namespace DotRecast.Detour { - using static DotRecast.Core.RecastMath; + using static DotRecast.Core.RcMath; /** * The Default Implementation diff --git a/src/DotRecast.Detour/DefaultQueryHeuristic.cs b/src/DotRecast.Detour/DefaultQueryHeuristic.cs index 8f80a82..e79ac6f 100644 --- a/src/DotRecast.Detour/DefaultQueryHeuristic.cs +++ b/src/DotRecast.Detour/DefaultQueryHeuristic.cs @@ -17,7 +17,7 @@ freely, subject to the following restrictions: */ using DotRecast.Core; -using static DotRecast.Core.RecastMath; +using static DotRecast.Core.RcMath; namespace DotRecast.Detour { diff --git a/src/DotRecast.Detour/FindNearestPolyQuery.cs b/src/DotRecast.Detour/FindNearestPolyQuery.cs index 380155b..440e7ec 100644 --- a/src/DotRecast.Detour/FindNearestPolyQuery.cs +++ b/src/DotRecast.Detour/FindNearestPolyQuery.cs @@ -4,7 +4,7 @@ using DotRecast.Detour.QueryResults; namespace DotRecast.Detour { - using static DotRecast.Core.RecastMath; + using static DotRecast.Core.RcMath; public class FindNearestPolyQuery : IPolyQuery { diff --git a/src/DotRecast.Detour/Io/DetourWriter.cs b/src/DotRecast.Detour/Io/DetourWriter.cs index 7c50c32..5ff55cc 100644 --- a/src/DotRecast.Detour/Io/DetourWriter.cs +++ b/src/DotRecast.Detour/Io/DetourWriter.cs @@ -24,16 +24,16 @@ namespace DotRecast.Detour.Io { public abstract class DetourWriter { - protected void Write(BinaryWriter stream, float value, ByteOrder order) + protected void Write(BinaryWriter stream, float value, RcByteOrder order) { byte[] bytes = BitConverter.GetBytes(value); int i = BitConverter.ToInt32(bytes, 0); Write(stream, i, order); } - protected void Write(BinaryWriter stream, short value, ByteOrder order) + protected void Write(BinaryWriter stream, short value, RcByteOrder order) { - if (order == ByteOrder.BIG_ENDIAN) + if (order == RcByteOrder.BIG_ENDIAN) { stream.Write((byte)((value >> 8) & 0xFF)); stream.Write((byte)(value & 0xFF)); @@ -45,9 +45,9 @@ namespace DotRecast.Detour.Io } } - protected void Write(BinaryWriter stream, long value, ByteOrder order) + protected void Write(BinaryWriter stream, long value, RcByteOrder order) { - if (order == ByteOrder.BIG_ENDIAN) + if (order == RcByteOrder.BIG_ENDIAN) { Write(stream, (int)((ulong)value >> 32), order); Write(stream, (int)(value & 0xFFFFFFFF), order); @@ -59,9 +59,9 @@ namespace DotRecast.Detour.Io } } - protected void Write(BinaryWriter stream, int value, ByteOrder order) + protected void Write(BinaryWriter stream, int value, RcByteOrder order) { - if (order == ByteOrder.BIG_ENDIAN) + if (order == RcByteOrder.BIG_ENDIAN) { stream.Write((byte)((value >> 24) & 0xFF)); stream.Write((byte)((value >> 16) & 0xFF)); diff --git a/src/DotRecast.Detour/Io/IOUtils.cs b/src/DotRecast.Detour/Io/IOUtils.cs index c2f5bfc..6b90152 100644 --- a/src/DotRecast.Detour/Io/IOUtils.cs +++ b/src/DotRecast.Detour/Io/IOUtils.cs @@ -24,7 +24,7 @@ namespace DotRecast.Detour.Io { public static class IOUtils { - public static ByteBuffer ToByteBuffer(BinaryReader @is, bool direct) + public static RcByteBuffer ToByteBuffer(BinaryReader @is, bool direct) { byte[] data = ToByteArray(@is); if (direct) @@ -32,7 +32,7 @@ namespace DotRecast.Detour.Io Array.Reverse(data); } - return new ByteBuffer(data); + return new RcByteBuffer(data); } public static byte[] ToByteArray(BinaryReader inputStream) @@ -49,10 +49,10 @@ namespace DotRecast.Detour.Io } - public static ByteBuffer ToByteBuffer(BinaryReader inputStream) + public static RcByteBuffer ToByteBuffer(BinaryReader inputStream) { var bytes = ToByteArray(inputStream); - return new ByteBuffer(bytes); + return new RcByteBuffer(bytes); } public static int SwapEndianness(int i) diff --git a/src/DotRecast.Detour/Io/MeshDataReader.cs b/src/DotRecast.Detour/Io/MeshDataReader.cs index e37d977..c8fbfce 100644 --- a/src/DotRecast.Detour/Io/MeshDataReader.cs +++ b/src/DotRecast.Detour/Io/MeshDataReader.cs @@ -27,27 +27,27 @@ namespace DotRecast.Detour.Io public MeshData Read(BinaryReader stream, int maxVertPerPoly) { - ByteBuffer buf = IOUtils.ToByteBuffer(stream); + RcByteBuffer buf = IOUtils.ToByteBuffer(stream); return Read(buf, maxVertPerPoly, false); } - public MeshData Read(ByteBuffer buf, int maxVertPerPoly) + public MeshData Read(RcByteBuffer buf, int maxVertPerPoly) { return Read(buf, maxVertPerPoly, false); } public MeshData Read32Bit(BinaryReader stream, int maxVertPerPoly) { - ByteBuffer buf = IOUtils.ToByteBuffer(stream); + RcByteBuffer buf = IOUtils.ToByteBuffer(stream); return Read(buf, maxVertPerPoly, true); } - public MeshData Read32Bit(ByteBuffer buf, int maxVertPerPoly) + public MeshData Read32Bit(RcByteBuffer buf, int maxVertPerPoly) { return Read(buf, maxVertPerPoly, true); } - public MeshData Read(ByteBuffer buf, int maxVertPerPoly, bool is32Bit) + public MeshData Read(RcByteBuffer buf, int maxVertPerPoly, bool is32Bit) { MeshData data = new MeshData(); MeshHeader header = new MeshHeader(); @@ -61,7 +61,7 @@ namespace DotRecast.Detour.Io throw new IOException("Invalid magic"); } - buf.Order(buf.Order() == ByteOrder.BIG_ENDIAN ? ByteOrder.LITTLE_ENDIAN : ByteOrder.BIG_ENDIAN); + buf.Order(buf.Order() == RcByteOrder.BIG_ENDIAN ? RcByteOrder.LITTLE_ENDIAN : RcByteOrder.BIG_ENDIAN); } header.version = buf.GetInt(); @@ -124,7 +124,7 @@ namespace DotRecast.Detour.Io return is32Bit ? LINK_SIZEOF32BIT : LINK_SIZEOF; } - private float[] ReadVerts(ByteBuffer buf, int count) + private float[] ReadVerts(RcByteBuffer buf, int count) { float[] verts = new float[count * 3]; for (int i = 0; i < verts.Length; i++) @@ -135,7 +135,7 @@ namespace DotRecast.Detour.Io return verts; } - private Poly[] ReadPolys(ByteBuffer buf, MeshHeader header, int maxVertPerPoly) + private Poly[] ReadPolys(RcByteBuffer buf, MeshHeader header, int maxVertPerPoly) { Poly[] polys = new Poly[header.polyCount]; for (int i = 0; i < polys.Length; i++) @@ -164,7 +164,7 @@ namespace DotRecast.Detour.Io return polys; } - private PolyDetail[] ReadPolyDetails(ByteBuffer buf, MeshHeader header, bool cCompatibility) + private PolyDetail[] ReadPolyDetails(RcByteBuffer buf, MeshHeader header, bool cCompatibility) { PolyDetail[] polys = new PolyDetail[header.detailMeshCount]; for (int i = 0; i < polys.Length; i++) @@ -183,7 +183,7 @@ namespace DotRecast.Detour.Io return polys; } - private int[] ReadDTris(ByteBuffer buf, MeshHeader header) + private int[] ReadDTris(RcByteBuffer buf, MeshHeader header) { int[] tris = new int[4 * header.detailTriCount]; for (int i = 0; i < tris.Length; i++) @@ -194,7 +194,7 @@ namespace DotRecast.Detour.Io return tris; } - private BVNode[] ReadBVTree(ByteBuffer buf, MeshHeader header) + private BVNode[] ReadBVTree(RcByteBuffer buf, MeshHeader header) { BVNode[] nodes = new BVNode[header.bvNodeCount]; for (int i = 0; i < nodes.Length; i++) @@ -231,7 +231,7 @@ namespace DotRecast.Detour.Io return nodes; } - private OffMeshConnection[] ReadOffMeshCons(ByteBuffer buf, MeshHeader header) + private OffMeshConnection[] ReadOffMeshCons(RcByteBuffer buf, MeshHeader header) { OffMeshConnection[] cons = new OffMeshConnection[header.offMeshConCount]; for (int i = 0; i < cons.Length; i++) diff --git a/src/DotRecast.Detour/Io/MeshDataWriter.cs b/src/DotRecast.Detour/Io/MeshDataWriter.cs index c23f0b2..a4e9d41 100644 --- a/src/DotRecast.Detour/Io/MeshDataWriter.cs +++ b/src/DotRecast.Detour/Io/MeshDataWriter.cs @@ -23,7 +23,7 @@ namespace DotRecast.Detour.Io { public class MeshDataWriter : DetourWriter { - public void Write(BinaryWriter stream, MeshData data, ByteOrder order, bool cCompatibility) + public void Write(BinaryWriter stream, MeshData data, RcByteOrder order, bool cCompatibility) { MeshHeader header = data.header; Write(stream, header.magic, order); @@ -66,7 +66,7 @@ namespace DotRecast.Detour.Io WriteOffMeshCons(stream, data, order); } - private void WriteVerts(BinaryWriter stream, float[] verts, int count, ByteOrder order) + private void WriteVerts(BinaryWriter stream, float[] verts, int count, RcByteOrder order) { for (int i = 0; i < count * 3; i++) { @@ -74,7 +74,7 @@ namespace DotRecast.Detour.Io } } - private void WritePolys(BinaryWriter stream, MeshData data, ByteOrder order, bool cCompatibility) + private void WritePolys(BinaryWriter stream, MeshData data, RcByteOrder order, bool cCompatibility) { for (int i = 0; i < data.header.polyCount; i++) { @@ -99,7 +99,7 @@ namespace DotRecast.Detour.Io } } - private void WritePolyDetails(BinaryWriter stream, MeshData data, ByteOrder order, bool cCompatibility) + private void WritePolyDetails(BinaryWriter stream, MeshData data, RcByteOrder order, bool cCompatibility) { for (int i = 0; i < data.header.detailMeshCount; i++) { @@ -122,7 +122,7 @@ namespace DotRecast.Detour.Io } } - private void WriteBVTree(BinaryWriter stream, MeshData data, ByteOrder order, bool cCompatibility) + private void WriteBVTree(BinaryWriter stream, MeshData data, RcByteOrder order, bool cCompatibility) { for (int i = 0; i < data.header.bvNodeCount; i++) { @@ -155,7 +155,7 @@ namespace DotRecast.Detour.Io } } - private void WriteOffMeshCons(BinaryWriter stream, MeshData data, ByteOrder order) + private void WriteOffMeshCons(BinaryWriter stream, MeshData data, RcByteOrder order) { for (int i = 0; i < data.header.offMeshConCount; i++) { diff --git a/src/DotRecast.Detour/Io/MeshSetReader.cs b/src/DotRecast.Detour/Io/MeshSetReader.cs index aa97399..41aec91 100644 --- a/src/DotRecast.Detour/Io/MeshSetReader.cs +++ b/src/DotRecast.Detour/Io/MeshSetReader.cs @@ -22,7 +22,7 @@ using DotRecast.Core; namespace DotRecast.Detour.Io { - using static DotRecast.Core.RecastMath; + using static DotRecast.Core.RcMath; public class MeshSetReader @@ -35,7 +35,7 @@ namespace DotRecast.Detour.Io return Read(IOUtils.ToByteBuffer(@is), maxVertPerPoly, false); } - public NavMesh Read(ByteBuffer bb, int maxVertPerPoly) + public NavMesh Read(RcByteBuffer bb, int maxVertPerPoly) { return Read(bb, maxVertPerPoly, false); } @@ -45,7 +45,7 @@ namespace DotRecast.Detour.Io return Read(IOUtils.ToByteBuffer(@is), maxVertPerPoly, true); } - public NavMesh Read32Bit(ByteBuffer bb, int maxVertPerPoly) + public NavMesh Read32Bit(RcByteBuffer bb, int maxVertPerPoly) { return Read(bb, maxVertPerPoly, true); } @@ -55,12 +55,12 @@ namespace DotRecast.Detour.Io return Read(IOUtils.ToByteBuffer(@is)); } - public NavMesh Read(ByteBuffer bb) + public NavMesh Read(RcByteBuffer bb) { return Read(bb, -1, false); } - NavMesh Read(ByteBuffer bb, int maxVertPerPoly, bool is32Bit) + NavMesh Read(RcByteBuffer bb, int maxVertPerPoly, bool is32Bit) { NavMeshSetHeader header = ReadHeader(bb, maxVertPerPoly); if (header.maxVertsPerPoly <= 0) @@ -74,7 +74,7 @@ namespace DotRecast.Detour.Io return mesh; } - private NavMeshSetHeader ReadHeader(ByteBuffer bb, int maxVertsPerPoly) + private NavMeshSetHeader ReadHeader(RcByteBuffer bb, int maxVertsPerPoly) { NavMeshSetHeader header = new NavMeshSetHeader(); header.magic = bb.GetInt(); @@ -86,7 +86,7 @@ namespace DotRecast.Detour.Io throw new IOException("Invalid magic " + header.magic); } - bb.Order(bb.Order() == ByteOrder.BIG_ENDIAN ? ByteOrder.LITTLE_ENDIAN : ByteOrder.BIG_ENDIAN); + bb.Order(bb.Order() == RcByteOrder.BIG_ENDIAN ? RcByteOrder.LITTLE_ENDIAN : RcByteOrder.BIG_ENDIAN); } header.version = bb.GetInt(); @@ -107,7 +107,7 @@ namespace DotRecast.Detour.Io return header; } - private void ReadTiles(ByteBuffer bb, bool is32Bit, NavMeshSetHeader header, bool cCompatibility, NavMesh mesh) + private void ReadTiles(RcByteBuffer bb, bool is32Bit, NavMeshSetHeader header, bool cCompatibility, NavMesh mesh) { // Read tiles. for (int i = 0; i < header.numTiles; ++i) diff --git a/src/DotRecast.Detour/Io/MeshSetWriter.cs b/src/DotRecast.Detour/Io/MeshSetWriter.cs index 5be824a..b7709d2 100644 --- a/src/DotRecast.Detour/Io/MeshSetWriter.cs +++ b/src/DotRecast.Detour/Io/MeshSetWriter.cs @@ -26,13 +26,13 @@ namespace DotRecast.Detour.Io private readonly MeshDataWriter writer = new MeshDataWriter(); private readonly NavMeshParamWriter paramWriter = new NavMeshParamWriter(); - public void Write(BinaryWriter stream, NavMesh mesh, ByteOrder order, bool cCompatibility) + public void Write(BinaryWriter stream, NavMesh mesh, RcByteOrder order, bool cCompatibility) { WriteHeader(stream, mesh, order, cCompatibility); WriteTiles(stream, mesh, order, cCompatibility); } - private void WriteHeader(BinaryWriter stream, NavMesh mesh, ByteOrder order, bool cCompatibility) + private void WriteHeader(BinaryWriter stream, NavMesh mesh, RcByteOrder order, bool cCompatibility) { Write(stream, NavMeshSetHeader.NAVMESHSET_MAGIC, order); Write(stream, cCompatibility ? NavMeshSetHeader.NAVMESHSET_VERSION : NavMeshSetHeader.NAVMESHSET_VERSION_RECAST4J, order); @@ -56,7 +56,7 @@ namespace DotRecast.Detour.Io } } - private void WriteTiles(BinaryWriter stream, NavMesh mesh, ByteOrder order, bool cCompatibility) + private void WriteTiles(BinaryWriter stream, NavMesh mesh, RcByteOrder order, bool cCompatibility) { for (int i = 0; i < mesh.GetMaxTiles(); ++i) { diff --git a/src/DotRecast.Detour/Io/NavMeshParamReader.cs b/src/DotRecast.Detour/Io/NavMeshParamReader.cs index 34218c6..168f29a 100644 --- a/src/DotRecast.Detour/Io/NavMeshParamReader.cs +++ b/src/DotRecast.Detour/Io/NavMeshParamReader.cs @@ -4,7 +4,7 @@ namespace DotRecast.Detour.Io { public class NavMeshParamReader { - public NavMeshParams Read(ByteBuffer bb) + public NavMeshParams Read(RcByteBuffer bb) { NavMeshParams option = new NavMeshParams(); option.orig.x = bb.GetFloat(); diff --git a/src/DotRecast.Detour/Io/NavMeshParamWriter.cs b/src/DotRecast.Detour/Io/NavMeshParamWriter.cs index dca973c..5c402f4 100644 --- a/src/DotRecast.Detour/Io/NavMeshParamWriter.cs +++ b/src/DotRecast.Detour/Io/NavMeshParamWriter.cs @@ -5,7 +5,7 @@ namespace DotRecast.Detour.Io { public class NavMeshParamWriter : DetourWriter { - public void Write(BinaryWriter stream, NavMeshParams option, ByteOrder order) + public void Write(BinaryWriter stream, NavMeshParams option, RcByteOrder order) { Write(stream, option.orig.x, order); Write(stream, option.orig.y, order); diff --git a/src/DotRecast.Detour/LegacyNavMeshQuery.cs b/src/DotRecast.Detour/LegacyNavMeshQuery.cs index 41bb5de..c8ced2c 100644 --- a/src/DotRecast.Detour/LegacyNavMeshQuery.cs +++ b/src/DotRecast.Detour/LegacyNavMeshQuery.cs @@ -23,7 +23,7 @@ using DotRecast.Detour.QueryResults; namespace DotRecast.Detour { - using static DotRecast.Core.RecastMath; + using static DotRecast.Core.RcMath; public class LegacyNavMeshQuery : NavMeshQuery diff --git a/src/DotRecast.Detour/NavMesh.cs b/src/DotRecast.Detour/NavMesh.cs index 09e810d..844aef9 100644 --- a/src/DotRecast.Detour/NavMesh.cs +++ b/src/DotRecast.Detour/NavMesh.cs @@ -27,7 +27,7 @@ using DotRecast.Detour.QueryResults; namespace DotRecast.Detour { - using static DotRecast.Core.RecastMath; + using static DotRecast.Core.RcMath; public class NavMesh { diff --git a/src/DotRecast.Detour/NavMeshBuilder.cs b/src/DotRecast.Detour/NavMeshBuilder.cs index 8cb1357..28bdd58 100644 --- a/src/DotRecast.Detour/NavMeshBuilder.cs +++ b/src/DotRecast.Detour/NavMeshBuilder.cs @@ -23,7 +23,7 @@ using DotRecast.Core; namespace DotRecast.Detour { - using static DotRecast.Core.RecastMath; + using static DotRecast.Core.RcMath; public class NavMeshBuilder { diff --git a/src/DotRecast.Detour/NavMeshQuery.cs b/src/DotRecast.Detour/NavMeshQuery.cs index 8195983..0d210ed 100644 --- a/src/DotRecast.Detour/NavMeshQuery.cs +++ b/src/DotRecast.Detour/NavMeshQuery.cs @@ -27,7 +27,7 @@ using DotRecast.Detour.QueryResults; namespace DotRecast.Detour { - using static DotRecast.Core.RecastMath; + using static DotRecast.Core.RcMath; using static Node; public class NavMeshQuery diff --git a/src/DotRecast.Detour/NodeQueue.cs b/src/DotRecast.Detour/NodeQueue.cs index 8ff6c64..0045c97 100644 --- a/src/DotRecast.Detour/NodeQueue.cs +++ b/src/DotRecast.Detour/NodeQueue.cs @@ -26,7 +26,7 @@ namespace DotRecast.Detour public class NodeQueue { - private readonly SortedQueue m_heap = new SortedQueue((n1, n2) => n1.total.CompareTo(n2.total)); + private readonly RcSortedQueue m_heap = new RcSortedQueue((n1, n2) => n1.total.CompareTo(n2.total)); public int Count() { diff --git a/src/DotRecast.Detour/StraightPathItem.cs b/src/DotRecast.Detour/StraightPathItem.cs index 77591e7..f35fcf1 100644 --- a/src/DotRecast.Detour/StraightPathItem.cs +++ b/src/DotRecast.Detour/StraightPathItem.cs @@ -22,7 +22,7 @@ using DotRecast.Core; namespace DotRecast.Detour { - using static DotRecast.Core.RecastMath; + using static DotRecast.Core.RcMath; //TODO: (PP) Add comments public class StraightPathItem diff --git a/src/DotRecast.Detour/StrictPolygonByCircleConstraint.cs b/src/DotRecast.Detour/StrictPolygonByCircleConstraint.cs index ce39637..72eaf74 100644 --- a/src/DotRecast.Detour/StrictPolygonByCircleConstraint.cs +++ b/src/DotRecast.Detour/StrictPolygonByCircleConstraint.cs @@ -3,7 +3,7 @@ using DotRecast.Core; namespace DotRecast.Detour { - using static DotRecast.Core.RecastMath; + using static DotRecast.Core.RcMath; /** * Calculate the intersection between a polygon and a circle. A dodecagon is used as an approximation of the circle. diff --git a/src/DotRecast.Recast.Demo/Builder/TileNavMeshBuilder.cs b/src/DotRecast.Recast.Demo/Builder/TileNavMeshBuilder.cs index 4ba44a9..3301852 100644 --- a/src/DotRecast.Recast.Demo/Builder/TileNavMeshBuilder.cs +++ b/src/DotRecast.Recast.Demo/Builder/TileNavMeshBuilder.cs @@ -22,7 +22,7 @@ using System.Threading.Tasks; using DotRecast.Core; using DotRecast.Detour; using DotRecast.Recast.Demo.Geom; -using static DotRecast.Core.RecastMath; +using static DotRecast.Core.RcMath; namespace DotRecast.Recast.Demo.Builder; diff --git a/src/DotRecast.Recast.Demo/Draw/DebugDraw.cs b/src/DotRecast.Recast.Demo/Draw/DebugDraw.cs index a88c391..ddbc1d0 100644 --- a/src/DotRecast.Recast.Demo/Draw/DebugDraw.cs +++ b/src/DotRecast.Recast.Demo/Draw/DebugDraw.cs @@ -31,7 +31,7 @@ public class DebugDraw private readonly IOpenGLDraw openGlDraw; private readonly int[] boxIndices = { 7, 6, 5, 4, 0, 1, 2, 3, 1, 5, 6, 2, 3, 7, 4, 0, 2, 6, 7, 3, 0, 4, 5, 1, }; - private readonly float[][] frustumPlanes = ArrayUtils.Of(6, 4); + private readonly float[][] frustumPlanes = RcArrayUtils.Of(6, 4); // { // new[] { 0f, 0f, 0f, 0f }, // new[] { 0f, 0f, 0f, 0f }, diff --git a/src/DotRecast.Recast.Demo/Draw/GLU.cs b/src/DotRecast.Recast.Demo/Draw/GLU.cs index bf89e75..a5a4845 100644 --- a/src/DotRecast.Recast.Demo/Draw/GLU.cs +++ b/src/DotRecast.Recast.Demo/Draw/GLU.cs @@ -128,7 +128,7 @@ public class GLU // This code comes directly from GLU except that it is for float static int GlhInvertMatrixf2(float[] m, float[] @out) { - float[][] wtmp = ArrayUtils.Of(4, 8); + float[][] wtmp = RcArrayUtils.Of(4, 8); float m0, m1, m2, m3, s; float[] r0, r1, r2, r3; r0 = wtmp[0]; diff --git a/src/DotRecast.Recast.Demo/RecastDemo.cs b/src/DotRecast.Recast.Demo/RecastDemo.cs index a468f9b..f94fa8f 100644 --- a/src/DotRecast.Recast.Demo/RecastDemo.cs +++ b/src/DotRecast.Recast.Demo/RecastDemo.cs @@ -40,7 +40,7 @@ using DotRecast.Recast.Demo.Draw; using DotRecast.Recast.Demo.Geom; using DotRecast.Recast.Demo.Tools; using DotRecast.Recast.Demo.UI; -using static DotRecast.Core.RecastMath; +using static DotRecast.Core.RcMath; using Window = Silk.NET.Windowing.Window; namespace DotRecast.Recast.Demo; diff --git a/src/DotRecast.Recast.Demo/Tools/ConvexVolumeTool.cs b/src/DotRecast.Recast.Demo/Tools/ConvexVolumeTool.cs index 1f3f081..6137c64 100644 --- a/src/DotRecast.Recast.Demo/Tools/ConvexVolumeTool.cs +++ b/src/DotRecast.Recast.Demo/Tools/ConvexVolumeTool.cs @@ -80,7 +80,7 @@ public class ConvexVolumeTool : Tool // Create // If clicked on that last pt, create the shape. - if (pts.Count > 0 && RecastMath.VDistSqr(p, Vector3f.Of(pts[pts.Count - 3], pts[pts.Count - 2], pts[pts.Count - 1])) < 0.2f * 0.2f) + if (pts.Count > 0 && RcMath.VDistSqr(p, Vector3f.Of(pts[pts.Count - 3], pts[pts.Count - 2], pts[pts.Count - 1])) < 0.2f * 0.2f) { if (hull.Count > 2) { @@ -108,7 +108,7 @@ public class ConvexVolumeTool : Tool int noffset = PolyUtils.OffsetPoly(verts, hull.Count, polyOffset, offset, offset.Length); if (noffset > 0) { - geom.AddConvexVolume(ArrayUtils.CopyOf(offset, 0, noffset * 3), minh, maxh, areaType); + geom.AddConvexVolume(RcArrayUtils.CopyOf(offset, 0, noffset * 3), minh, maxh, areaType); } } else diff --git a/src/DotRecast.Recast.Demo/Tools/CrowdProfilingTool.cs b/src/DotRecast.Recast.Demo/Tools/CrowdProfilingTool.cs index a326289..6326761 100644 --- a/src/DotRecast.Recast.Demo/Tools/CrowdProfilingTool.cs +++ b/src/DotRecast.Recast.Demo/Tools/CrowdProfilingTool.cs @@ -189,7 +189,7 @@ public class CrowdProfilingTool bool valid = true; foreach (FindRandomPointResult zone in zones) { - if (RecastMath.VDistSqr(zone.GetRandomPt(), result.result.GetRandomPt()) < zoneSeparation) + if (RcMath.VDistSqr(zone.GetRandomPt(), result.result.GetRandomPt()) < zoneSeparation) { valid = false; break; @@ -313,7 +313,7 @@ public class CrowdProfilingTool List potentialTargets = new(); foreach (FindRandomPointResult zone in zones) { - if (RecastMath.VDistSqr(zone.GetRandomPt(), ag.npos) > zoneRadius * zoneRadius) + if (RcMath.VDistSqr(zone.GetRandomPt(), ag.npos) > zoneRadius * zoneRadius) { potentialTargets.Add(zone); } diff --git a/src/DotRecast.Recast.Demo/Tools/CrowdTool.cs b/src/DotRecast.Recast.Demo/Tools/CrowdTool.cs index decac0c..18dcee8 100644 --- a/src/DotRecast.Recast.Demo/Tools/CrowdTool.cs +++ b/src/DotRecast.Recast.Demo/Tools/CrowdTool.cs @@ -32,7 +32,7 @@ using DotRecast.Recast.Demo.Geom; using ImGuiNET; using static DotRecast.Recast.Demo.Draw.DebugDraw; using static DotRecast.Recast.Demo.Draw.DebugDrawPrimitives; -using static DotRecast.Core.RecastMath; +using static DotRecast.Core.RcMath; namespace DotRecast.Recast.Demo.Tools; diff --git a/src/DotRecast.Recast.Demo/Tools/DynamicUpdateTool.cs b/src/DotRecast.Recast.Demo/Tools/DynamicUpdateTool.cs index 24325ed..8c7487f 100644 --- a/src/DotRecast.Recast.Demo/Tools/DynamicUpdateTool.cs +++ b/src/DotRecast.Recast.Demo/Tools/DynamicUpdateTool.cs @@ -40,7 +40,7 @@ using Silk.NET.OpenAL; using Silk.NET.Windowing; using static DotRecast.Recast.Demo.Draw.DebugDraw; using static DotRecast.Recast.Demo.Draw.DebugDrawPrimitives; -using static DotRecast.Core.RecastMath; +using static DotRecast.Core.RcMath; namespace DotRecast.Recast.Demo.Tools; diff --git a/src/DotRecast.Recast.Demo/Tools/Gizmos/CapsuleGizmo.cs b/src/DotRecast.Recast.Demo/Tools/Gizmos/CapsuleGizmo.cs index 316852f..52170b8 100644 --- a/src/DotRecast.Recast.Demo/Tools/Gizmos/CapsuleGizmo.cs +++ b/src/DotRecast.Recast.Demo/Tools/Gizmos/CapsuleGizmo.cs @@ -1,7 +1,7 @@ using DotRecast.Core; using DotRecast.Recast.Demo.Draw; using static DotRecast.Recast.RecastVectors; -using static DotRecast.Core.RecastMath; +using static DotRecast.Core.RcMath; using static DotRecast.Recast.Demo.Tools.Gizmos.GizmoHelper; namespace DotRecast.Recast.Demo.Tools.Gizmos; diff --git a/src/DotRecast.Recast.Demo/Tools/Gizmos/CylinderGizmo.cs b/src/DotRecast.Recast.Demo/Tools/Gizmos/CylinderGizmo.cs index 1b8780b..ed7e136 100644 --- a/src/DotRecast.Recast.Demo/Tools/Gizmos/CylinderGizmo.cs +++ b/src/DotRecast.Recast.Demo/Tools/Gizmos/CylinderGizmo.cs @@ -1,7 +1,7 @@ using DotRecast.Core; using DotRecast.Recast.Demo.Draw; using static DotRecast.Recast.RecastVectors; -using static DotRecast.Core.RecastMath; +using static DotRecast.Core.RcMath; using static DotRecast.Recast.Demo.Tools.Gizmos.GizmoHelper; diff --git a/src/DotRecast.Recast.Demo/Tools/Gizmos/GizmoHelper.cs b/src/DotRecast.Recast.Demo/Tools/Gizmos/GizmoHelper.cs index e72431f..162b773 100644 --- a/src/DotRecast.Recast.Demo/Tools/Gizmos/GizmoHelper.cs +++ b/src/DotRecast.Recast.Demo/Tools/Gizmos/GizmoHelper.cs @@ -1,7 +1,7 @@ using System; using DotRecast.Core; using DotRecast.Recast.Demo.Draw; -using static DotRecast.Core.RecastMath; +using static DotRecast.Core.RcMath; namespace DotRecast.Recast.Demo.Tools.Gizmos; diff --git a/src/DotRecast.Recast.Demo/Tools/Gizmos/SphereGizmo.cs b/src/DotRecast.Recast.Demo/Tools/Gizmos/SphereGizmo.cs index fc6faac..7215c0f 100644 --- a/src/DotRecast.Recast.Demo/Tools/Gizmos/SphereGizmo.cs +++ b/src/DotRecast.Recast.Demo/Tools/Gizmos/SphereGizmo.cs @@ -1,6 +1,6 @@ using DotRecast.Core; using DotRecast.Recast.Demo.Draw; -using static DotRecast.Core.RecastMath; +using static DotRecast.Core.RcMath; using static DotRecast.Recast.Demo.Tools.Gizmos.GizmoHelper; diff --git a/src/DotRecast.Recast.Demo/Tools/JumpLinkBuilderTool.cs b/src/DotRecast.Recast.Demo/Tools/JumpLinkBuilderTool.cs index 2b1046e..778162c 100644 --- a/src/DotRecast.Recast.Demo/Tools/JumpLinkBuilderTool.cs +++ b/src/DotRecast.Recast.Demo/Tools/JumpLinkBuilderTool.cs @@ -25,7 +25,7 @@ using DotRecast.Recast.Demo.Builder; using DotRecast.Recast.Demo.Draw; using DotRecast.Recast.Demo.Geom; using ImGuiNET; -using static DotRecast.Core.RecastMath; +using static DotRecast.Core.RcMath; using static DotRecast.Recast.Demo.Draw.DebugDraw; using static DotRecast.Recast.Demo.Draw.DebugDrawPrimitives; diff --git a/src/DotRecast.Recast.Demo/Tools/OffMeshConnectionTool.cs b/src/DotRecast.Recast.Demo/Tools/OffMeshConnectionTool.cs index 7d04c66..4f8fd42 100644 --- a/src/DotRecast.Recast.Demo/Tools/OffMeshConnectionTool.cs +++ b/src/DotRecast.Recast.Demo/Tools/OffMeshConnectionTool.cs @@ -57,7 +57,7 @@ public class OffMeshConnectionTool : Tool DemoOffMeshConnection nearestConnection = null; foreach (DemoOffMeshConnection offMeshCon in geom.GetOffMeshConnections()) { - float d = Math.Min(RecastMath.VDistSqr(p, offMeshCon.verts, 0), RecastMath.VDistSqr(p, offMeshCon.verts, 3)); + float d = Math.Min(RcMath.VDistSqr(p, offMeshCon.verts, 0), RcMath.VDistSqr(p, offMeshCon.verts, 3)); if (d < nearestDist && Math.Sqrt(d) < sample.GetSettingsUI().GetAgentRadius()) { nearestDist = d; diff --git a/src/DotRecast.Recast.Demo/Tools/TestNavmeshTool.cs b/src/DotRecast.Recast.Demo/Tools/TestNavmeshTool.cs index c832cea..de0fcbf 100644 --- a/src/DotRecast.Recast.Demo/Tools/TestNavmeshTool.cs +++ b/src/DotRecast.Recast.Demo/Tools/TestNavmeshTool.cs @@ -6,7 +6,7 @@ using DotRecast.Detour.QueryResults; using DotRecast.Recast.Demo.Builder; using DotRecast.Recast.Demo.Draw; using ImGuiNET; -using static DotRecast.Core.RecastMath; +using static DotRecast.Core.RcMath; using static DotRecast.Recast.Demo.Draw.DebugDraw; using static DotRecast.Recast.Demo.Draw.DebugDrawPrimitives; @@ -168,7 +168,7 @@ public class TestNavmeshTool : Tool NavMeshQuery m_navQuery = m_sample.GetNavMeshQuery(); if (m_sposSet) { - m_startRef = m_navQuery.FindNearestPoly(m_spos, m_polyPickExt, m_filter).result.GetNearestRef(); + m_startRef = m_navQuery.FindNearestPoly(m_spos, m_polyPickExt, m_filter).result?.GetNearestRef() ?? 0; } else { @@ -177,7 +177,7 @@ public class TestNavmeshTool : Tool if (m_eposSet) { - m_endRef = m_navQuery.FindNearestPoly(m_epos, m_polyPickExt, m_filter).result.GetNearestRef(); + m_endRef = m_navQuery.FindNearestPoly(m_epos, m_polyPickExt, m_filter).result?.GetNearestRef() ?? 0; } else { @@ -850,7 +850,7 @@ public class TestNavmeshTool : Tool Vector3f s3 = Vector3f.Of(s[3], s[4], s[5]); // Skip too distant segments. Tuple distSqr = DistancePtSegSqr2D(m_spos, s, 0, 3); - if (distSqr.Item1 > RecastMath.Sqr(m_neighbourhoodRadius)) + if (distSqr.Item1 > RcMath.Sqr(m_neighbourhoodRadius)) { continue; } diff --git a/src/DotRecast.Recast/RecastCompact.cs b/src/DotRecast.Recast/RecastCompact.cs index f8ac549..4300327 100644 --- a/src/DotRecast.Recast/RecastCompact.cs +++ b/src/DotRecast.Recast/RecastCompact.cs @@ -18,7 +18,7 @@ freely, subject to the following restrictions: using System; -using static DotRecast.Core.RecastMath; +using static DotRecast.Core.RcMath; using static DotRecast.Recast.RecastConstants; using static DotRecast.Recast.RecastVectors; diff --git a/src/DotRecast.Recast/RecastFilledVolumeRasterization.cs b/src/DotRecast.Recast/RecastFilledVolumeRasterization.cs index 11d2534..d5d55bb 100644 --- a/src/DotRecast.Recast/RecastFilledVolumeRasterization.cs +++ b/src/DotRecast.Recast/RecastFilledVolumeRasterization.cs @@ -18,7 +18,7 @@ freely, subject to the following restrictions: using System; using DotRecast.Core; -using static DotRecast.Core.RecastMath; +using static DotRecast.Core.RcMath; using static DotRecast.Recast.RecastConstants; using static DotRecast.Recast.RecastVectors; @@ -110,7 +110,7 @@ namespace DotRecast.Recast bounds[5] = Math.Max(bounds[5], vertices[i * 3 + 2]); } - float[][] planes = ArrayUtils.Of(6, 4); + float[][] planes = RcArrayUtils.Of(6, 4); for (int i = 0; i < 6; i++) { float m = i < 3 ? -1 : 1; @@ -142,8 +142,8 @@ namespace DotRecast.Recast } - float[][] planes = ArrayUtils.Of(triangles.Length, 4); - float[][] triBounds = ArrayUtils.Of(triangles.Length / 3, 4); + float[][] planes = RcArrayUtils.Of(triangles.Length, 4); + float[][] triBounds = RcArrayUtils.Of(triangles.Length / 3, 4); for (int i = 0, j = 0; i < triangles.Length; i += 3, j++) { int a = triangles[i] * 3; diff --git a/src/DotRecast.Recast/RecastMeshDetail.cs b/src/DotRecast.Recast/RecastMeshDetail.cs index 2ffb4a5..48ab218 100644 --- a/src/DotRecast.Recast/RecastMeshDetail.cs +++ b/src/DotRecast.Recast/RecastMeshDetail.cs @@ -21,7 +21,7 @@ freely, subject to the following restrictions: using System; using System.Collections.Generic; using DotRecast.Core; -using static DotRecast.Core.RecastMath; +using static DotRecast.Core.RcMath; using static DotRecast.Recast.RecastCommon; using static DotRecast.Recast.RecastConstants; diff --git a/src/DotRecast.Recast/RecastRasterization.cs b/src/DotRecast.Recast/RecastRasterization.cs index 3bffa8a..a7778f0 100644 --- a/src/DotRecast.Recast/RecastRasterization.cs +++ b/src/DotRecast.Recast/RecastRasterization.cs @@ -20,7 +20,7 @@ freely, subject to the following restrictions: using System; using DotRecast.Core; -using static DotRecast.Core.RecastMath; +using static DotRecast.Core.RcMath; using static DotRecast.Recast.RecastConstants; namespace DotRecast.Recast diff --git a/test/DotRecast.Detour.Crowd.Test/AbstractCrowdTest.cs b/test/DotRecast.Detour.Crowd.Test/AbstractCrowdTest.cs index 5e5a6eb..4ca7668 100644 --- a/test/DotRecast.Detour.Crowd.Test/AbstractCrowdTest.cs +++ b/test/DotRecast.Detour.Crowd.Test/AbstractCrowdTest.cs @@ -26,7 +26,7 @@ using NUnit.Framework; namespace DotRecast.Detour.Crowd.Test; -using static DotRecast.Core.RecastMath; +using static DotRecast.Core.RcMath; [Parallelizable] public class AbstractCrowdTest diff --git a/test/DotRecast.Detour.Extras.Test/Unity/Astar/UnityAStarPathfindingImporterTest.cs b/test/DotRecast.Detour.Extras.Test/Unity/Astar/UnityAStarPathfindingImporterTest.cs index b8d06db..02932e2 100644 --- a/test/DotRecast.Detour.Extras.Test/Unity/Astar/UnityAStarPathfindingImporterTest.cs +++ b/test/DotRecast.Detour.Extras.Test/Unity/Astar/UnityAStarPathfindingImporterTest.cs @@ -135,6 +135,6 @@ public class UnityAStarPathfindingImporterTest string filepath = Path.Combine("test-output", filename); using var fs = new FileStream(filename, FileMode.Create); using var os = new BinaryWriter(fs); - writer.Write(os, mesh, ByteOrder.LITTLE_ENDIAN, true); + writer.Write(os, mesh, RcByteOrder.LITTLE_ENDIAN, true); } } diff --git a/test/DotRecast.Detour.Test/Io/MeshDataReaderWriterTest.cs b/test/DotRecast.Detour.Test/Io/MeshDataReaderWriterTest.cs index f8559f0..f4246ee 100644 --- a/test/DotRecast.Detour.Test/Io/MeshDataReaderWriterTest.cs +++ b/test/DotRecast.Detour.Test/Io/MeshDataReaderWriterTest.cs @@ -39,28 +39,28 @@ public class MeshDataReaderWriterTest [Test] public void TestCCompatibility() { - Test(true, ByteOrder.BIG_ENDIAN); + Test(true, RcByteOrder.BIG_ENDIAN); } [Test] public void TestCompact() { - Test(false, ByteOrder.BIG_ENDIAN); + Test(false, RcByteOrder.BIG_ENDIAN); } [Test] public void TestCCompatibilityLE() { - Test(true, ByteOrder.LITTLE_ENDIAN); + Test(true, RcByteOrder.LITTLE_ENDIAN); } [Test] public void TestCompactLE() { - Test(false, ByteOrder.LITTLE_ENDIAN); + Test(false, RcByteOrder.LITTLE_ENDIAN); } - public void Test(bool cCompatibility, ByteOrder order) + public void Test(bool cCompatibility, RcByteOrder order) { using var ms = new MemoryStream(); using var bwos = new BinaryWriter(ms); diff --git a/test/DotRecast.Detour.Test/Io/MeshSetReaderWriterTest.cs b/test/DotRecast.Detour.Test/Io/MeshSetReaderWriterTest.cs index ac89403..2760ed1 100644 --- a/test/DotRecast.Detour.Test/Io/MeshSetReaderWriterTest.cs +++ b/test/DotRecast.Detour.Test/Io/MeshSetReaderWriterTest.cs @@ -23,7 +23,7 @@ using DotRecast.Detour.Io; using DotRecast.Recast; using DotRecast.Recast.Geom; using NUnit.Framework; -using static DotRecast.Core.RecastMath; +using static DotRecast.Core.RcMath; namespace DotRecast.Detour.Test.Io; @@ -94,7 +94,7 @@ public class MeshSetReaderWriterTest using var ms = new MemoryStream(); using var os = new BinaryWriter(ms); - writer.Write(os, mesh, ByteOrder.LITTLE_ENDIAN, true); + writer.Write(os, mesh, RcByteOrder.LITTLE_ENDIAN, true); ms.Seek(0, SeekOrigin.Begin); using var @is = new BinaryReader(ms); diff --git a/test/DotRecast.Detour.Test/RandomPointTest.cs b/test/DotRecast.Detour.Test/RandomPointTest.cs index a24c148..e797f61 100644 --- a/test/DotRecast.Detour.Test/RandomPointTest.cs +++ b/test/DotRecast.Detour.Test/RandomPointTest.cs @@ -21,7 +21,7 @@ using System.Diagnostics; using DotRecast.Core; using DotRecast.Detour.QueryResults; using NUnit.Framework; -using static DotRecast.Core.RecastMath; +using static DotRecast.Core.RcMath; namespace DotRecast.Detour.Test; diff --git a/test/DotRecast.Detour.TileCache.Test/AbstractTileCacheTest.cs b/test/DotRecast.Detour.TileCache.Test/AbstractTileCacheTest.cs index b337942..0d36c09 100644 --- a/test/DotRecast.Detour.TileCache.Test/AbstractTileCacheTest.cs +++ b/test/DotRecast.Detour.TileCache.Test/AbstractTileCacheTest.cs @@ -22,7 +22,7 @@ using DotRecast.Core; using DotRecast.Detour.TileCache.Io.Compress; using DotRecast.Recast.Geom; using NUnit.Framework; -using static DotRecast.Core.RecastMath; +using static DotRecast.Core.RcMath; using static DotRecast.Recast.RecastVectors; namespace DotRecast.Detour.TileCache.Test; @@ -50,7 +50,7 @@ public class AbstractTileCacheTest } } - public TileCache GetTileCache(IInputGeomProvider geom, ByteOrder order, bool cCompatibility) + public TileCache GetTileCache(IInputGeomProvider geom, RcByteOrder order, bool cCompatibility) { TileCacheParams option = new TileCacheParams(); int[] twh = Recast.Recast.CalcTileCount(geom.GetMeshBoundsMin(), geom.GetMeshBoundsMax(), m_cellSize, m_tileSize, m_tileSize); diff --git a/test/DotRecast.Detour.TileCache.Test/Io/TileCacheReaderWriterTest.cs b/test/DotRecast.Detour.TileCache.Test/Io/TileCacheReaderWriterTest.cs index 82b5f87..b3e6b71 100644 --- a/test/DotRecast.Detour.TileCache.Test/Io/TileCacheReaderWriterTest.cs +++ b/test/DotRecast.Detour.TileCache.Test/Io/TileCacheReaderWriterTest.cs @@ -52,8 +52,8 @@ public class TileCacheReaderWriterTest : AbstractTileCacheTest { IInputGeomProvider geom = ObjImporter.Load(Loader.ToBytes("dungeon.obj")); TestTileLayerBuilder layerBuilder = new TestTileLayerBuilder(geom); - List layers = layerBuilder.Build(ByteOrder.LITTLE_ENDIAN, cCompatibility, 1); - TileCache tc = GetTileCache(geom, ByteOrder.LITTLE_ENDIAN, cCompatibility); + List layers = layerBuilder.Build(RcByteOrder.LITTLE_ENDIAN, cCompatibility, 1); + TileCache tc = GetTileCache(geom, RcByteOrder.LITTLE_ENDIAN, cCompatibility); foreach (byte[] layer in layers) { long refs = tc.AddTile(layer, 0); @@ -62,7 +62,7 @@ public class TileCacheReaderWriterTest : AbstractTileCacheTest using var msout = new MemoryStream(); using var baos = new BinaryWriter(msout); - writer.Write(baos, tc, ByteOrder.LITTLE_ENDIAN, cCompatibility); + writer.Write(baos, tc, RcByteOrder.LITTLE_ENDIAN, cCompatibility); using var msis = new MemoryStream(msout.ToArray()); using var bais = new BinaryReader(msis); diff --git a/test/DotRecast.Detour.TileCache.Test/TempObstaclesTest.cs b/test/DotRecast.Detour.TileCache.Test/TempObstaclesTest.cs index a598dd8..1153e6c 100644 --- a/test/DotRecast.Detour.TileCache.Test/TempObstaclesTest.cs +++ b/test/DotRecast.Detour.TileCache.Test/TempObstaclesTest.cs @@ -35,8 +35,8 @@ public class TempObstaclesTest : AbstractTileCacheTest bool cCompatibility = true; IInputGeomProvider geom = ObjImporter.Load(Loader.ToBytes("dungeon.obj")); TestTileLayerBuilder layerBuilder = new TestTileLayerBuilder(geom); - List layers = layerBuilder.Build(ByteOrder.LITTLE_ENDIAN, cCompatibility, 1); - TileCache tc = GetTileCache(geom, ByteOrder.LITTLE_ENDIAN, cCompatibility); + List layers = layerBuilder.Build(RcByteOrder.LITTLE_ENDIAN, cCompatibility, 1); + TileCache tc = GetTileCache(geom, RcByteOrder.LITTLE_ENDIAN, cCompatibility); foreach (byte[] data in layers) { long refs = tc.AddTile(data, 0); @@ -69,8 +69,8 @@ public class TempObstaclesTest : AbstractTileCacheTest bool cCompatibility = true; IInputGeomProvider geom = ObjImporter.Load(Loader.ToBytes("dungeon.obj")); TestTileLayerBuilder layerBuilder = new TestTileLayerBuilder(geom); - List layers = layerBuilder.Build(ByteOrder.LITTLE_ENDIAN, cCompatibility, 1); - TileCache tc = GetTileCache(geom, ByteOrder.LITTLE_ENDIAN, cCompatibility); + List layers = layerBuilder.Build(RcByteOrder.LITTLE_ENDIAN, cCompatibility, 1); + TileCache tc = GetTileCache(geom, RcByteOrder.LITTLE_ENDIAN, cCompatibility); foreach (byte[] data in layers) { long refs = tc.AddTile(data, 0); diff --git a/test/DotRecast.Detour.TileCache.Test/TestTileLayerBuilder.cs b/test/DotRecast.Detour.TileCache.Test/TestTileLayerBuilder.cs index 83e3e42..7e89f30 100644 --- a/test/DotRecast.Detour.TileCache.Test/TestTileLayerBuilder.cs +++ b/test/DotRecast.Detour.TileCache.Test/TestTileLayerBuilder.cs @@ -22,7 +22,7 @@ using System.Collections.Generic; using DotRecast.Core; using DotRecast.Recast; using DotRecast.Recast.Geom; -using static DotRecast.Core.RecastMath; +using static DotRecast.Core.RcMath; namespace DotRecast.Detour.TileCache.Test; @@ -63,7 +63,7 @@ public class TestTileLayerBuilder : AbstractTileLayersBuilder th = twh[1]; } - public List Build(ByteOrder order, bool cCompatibility, int threads) + public List Build(RcByteOrder order, bool cCompatibility, int threads) { return Build(order, cCompatibility, threads, tw, th); } @@ -78,7 +78,7 @@ public class TestTileLayerBuilder : AbstractTileLayersBuilder return th; } - protected override List Build(int tx, int ty, ByteOrder order, bool cCompatibility) + protected override List Build(int tx, int ty, RcByteOrder order, bool cCompatibility) { HeightfieldLayerSet lset = GetHeightfieldSet(tx, ty); List result = new(); diff --git a/test/DotRecast.Detour.TileCache.Test/TileCacheNavigationTest.cs b/test/DotRecast.Detour.TileCache.Test/TileCacheNavigationTest.cs index 329d778..415f311 100644 --- a/test/DotRecast.Detour.TileCache.Test/TileCacheNavigationTest.cs +++ b/test/DotRecast.Detour.TileCache.Test/TileCacheNavigationTest.cs @@ -58,8 +58,8 @@ public class TileCacheNavigationTest : AbstractTileCacheTest bool cCompatibility = true; IInputGeomProvider geom = ObjImporter.Load(Loader.ToBytes("dungeon.obj")); TestTileLayerBuilder layerBuilder = new TestTileLayerBuilder(geom); - List layers = layerBuilder.Build(ByteOrder.LITTLE_ENDIAN, cCompatibility, 1); - TileCache tc = GetTileCache(geom, ByteOrder.LITTLE_ENDIAN, cCompatibility); + List layers = layerBuilder.Build(RcByteOrder.LITTLE_ENDIAN, cCompatibility, 1); + TileCache tc = GetTileCache(geom, RcByteOrder.LITTLE_ENDIAN, cCompatibility); foreach (byte[] data in layers) { tc.AddTile(data, 0); diff --git a/test/DotRecast.Detour.TileCache.Test/TileCacheTest.cs b/test/DotRecast.Detour.TileCache.Test/TileCacheTest.cs index f21e1c2..482b78d 100644 --- a/test/DotRecast.Detour.TileCache.Test/TileCacheTest.cs +++ b/test/DotRecast.Detour.TileCache.Test/TileCacheTest.cs @@ -34,30 +34,30 @@ public class TileCacheTest : AbstractTileCacheTest [Test] public void TestFastLz() { - TestDungeon(ByteOrder.LITTLE_ENDIAN, false); - TestDungeon(ByteOrder.LITTLE_ENDIAN, true); - TestDungeon(ByteOrder.BIG_ENDIAN, false); - TestDungeon(ByteOrder.BIG_ENDIAN, true); - Test(ByteOrder.LITTLE_ENDIAN, false); - Test(ByteOrder.LITTLE_ENDIAN, true); - Test(ByteOrder.BIG_ENDIAN, false); - Test(ByteOrder.BIG_ENDIAN, true); + TestDungeon(RcByteOrder.LITTLE_ENDIAN, false); + TestDungeon(RcByteOrder.LITTLE_ENDIAN, true); + TestDungeon(RcByteOrder.BIG_ENDIAN, false); + TestDungeon(RcByteOrder.BIG_ENDIAN, true); + Test(RcByteOrder.LITTLE_ENDIAN, false); + Test(RcByteOrder.LITTLE_ENDIAN, true); + Test(RcByteOrder.BIG_ENDIAN, false); + Test(RcByteOrder.BIG_ENDIAN, true); } [Test] public void TestLZ4() { - TestDungeon(ByteOrder.LITTLE_ENDIAN, false); - TestDungeon(ByteOrder.LITTLE_ENDIAN, true); - TestDungeon(ByteOrder.BIG_ENDIAN, false); - TestDungeon(ByteOrder.BIG_ENDIAN, true); - Test(ByteOrder.LITTLE_ENDIAN, false); - Test(ByteOrder.LITTLE_ENDIAN, true); - Test(ByteOrder.BIG_ENDIAN, false); - Test(ByteOrder.BIG_ENDIAN, true); + TestDungeon(RcByteOrder.LITTLE_ENDIAN, false); + TestDungeon(RcByteOrder.LITTLE_ENDIAN, true); + TestDungeon(RcByteOrder.BIG_ENDIAN, false); + TestDungeon(RcByteOrder.BIG_ENDIAN, true); + Test(RcByteOrder.LITTLE_ENDIAN, false); + Test(RcByteOrder.LITTLE_ENDIAN, true); + Test(RcByteOrder.BIG_ENDIAN, false); + Test(RcByteOrder.BIG_ENDIAN, true); } - private void TestDungeon(ByteOrder order, bool cCompatibility) + private void TestDungeon(RcByteOrder order, bool cCompatibility) { IInputGeomProvider geom = ObjImporter.Load(Loader.ToBytes("dungeon.obj")); TileCache tc = GetTileCache(geom, order, cCompatibility); @@ -153,7 +153,7 @@ public class TileCacheTest : AbstractTileCacheTest Assert.That(data.detailTris.Length, Is.EqualTo(4 * 3)); } - private void Test(ByteOrder order, bool cCompatibility) + private void Test(RcByteOrder order, bool cCompatibility) { IInputGeomProvider geom = ObjImporter.Load(Loader.ToBytes("nav_test.obj")); TileCache tc = GetTileCache(geom, order, cCompatibility); @@ -179,7 +179,7 @@ public class TileCacheTest : AbstractTileCacheTest public void TestPerformance() { int threads = 4; - ByteOrder order = ByteOrder.LITTLE_ENDIAN; + RcByteOrder order = RcByteOrder.LITTLE_ENDIAN; bool cCompatibility = false; IInputGeomProvider geom = ObjImporter.Load(Loader.ToBytes("dungeon.obj")); TestTileLayerBuilder layerBuilder = new TestTileLayerBuilder(geom);