diff --git a/README.md b/README.md
index 21ad42e..c3de012 100644
--- a/README.md
+++ b/README.md
@@ -1,3 +1,14 @@
# DotRecast
-- https://github.com/recastnavigation/recastnavigation
-- https://github.com/ppiastucki/recast4j
+DotRecast is a port of recast4j(https://github.com/ppiastucki/recast4j) to C# and has been built to target netstandard2.1 to work with both Unity and pure C#.
+
+If you're using Unity 3D, the following projects have been modified to build with netstandard2.1:
+
+- DotRecast.Core
+- DotRecast.Recast
+- DotRecast.Detour
+- DotRecast.Detour.Crowd
+- DotRecast.Detour.Dynamic
+- DotRecast.Detour.Extras
+- DotRecast.Detour.TileCache
+
+ Please feel free to copy and use these projects in Unity 3D. We plan to continue improving them as time goes on.
diff --git a/src/DotRecast.Core/ArrayUtils.cs b/src/DotRecast.Core/ArrayUtils.cs
index ac9d224..f2f6c43 100644
--- a/src/DotRecast.Core/ArrayUtils.cs
+++ b/src/DotRecast.Core/ArrayUtils.cs
@@ -1,6 +1,8 @@
using System;
-namespace DotRecast.Core;
+namespace DotRecast.Core
+{
+
public static class ArrayUtils
{
@@ -38,4 +40,5 @@ public static class ArrayUtils
return temp;
}
+}
}
\ No newline at end of file
diff --git a/src/DotRecast.Core/AtomicBoolean.cs b/src/DotRecast.Core/AtomicBoolean.cs
index 19724e5..2d7848c 100644
--- a/src/DotRecast.Core/AtomicBoolean.cs
+++ b/src/DotRecast.Core/AtomicBoolean.cs
@@ -1,6 +1,8 @@
using System.Threading;
-namespace DotRecast.Core;
+namespace DotRecast.Core
+{
+
public class AtomicBoolean
{
@@ -15,4 +17,5 @@ public class AtomicBoolean
{
return 0 != _location;
}
+}
}
\ No newline at end of file
diff --git a/src/DotRecast.Core/AtomicFloat.cs b/src/DotRecast.Core/AtomicFloat.cs
index 101a1bb..a9a1dd5 100644
--- a/src/DotRecast.Core/AtomicFloat.cs
+++ b/src/DotRecast.Core/AtomicFloat.cs
@@ -1,6 +1,8 @@
using System.Threading;
-namespace DotRecast.Core;
+namespace DotRecast.Core
+{
+
public class AtomicFloat
{
@@ -25,4 +27,5 @@ public class AtomicFloat
{
return Interlocked.CompareExchange(ref _location, value, comparand);
}
+}
}
\ No newline at end of file
diff --git a/src/DotRecast.Core/AtomicInteger.cs b/src/DotRecast.Core/AtomicInteger.cs
index 0f09510..97f02b2 100644
--- a/src/DotRecast.Core/AtomicInteger.cs
+++ b/src/DotRecast.Core/AtomicInteger.cs
@@ -1,6 +1,8 @@
using System.Threading;
-namespace DotRecast.Core;
+namespace DotRecast.Core
+{
+
public class AtomicInteger
{
@@ -63,4 +65,5 @@ public class AtomicInteger
return Interlocked.Add(ref _location, value);
}
+}
}
\ No newline at end of file
diff --git a/src/DotRecast.Core/AtomicLong.cs b/src/DotRecast.Core/AtomicLong.cs
index b3103e1..5046bda 100644
--- a/src/DotRecast.Core/AtomicLong.cs
+++ b/src/DotRecast.Core/AtomicLong.cs
@@ -1,6 +1,8 @@
using System.Threading;
-namespace DotRecast.Core;
+namespace DotRecast.Core
+{
+
public class AtomicLong
{
@@ -49,4 +51,5 @@ public class AtomicLong
{
return Interlocked.Add(ref _location, value);
}
+}
}
\ No newline at end of file
diff --git a/src/DotRecast.Core/ByteBuffer.cs b/src/DotRecast.Core/ByteBuffer.cs
index 96dc709..90c50af 100644
--- a/src/DotRecast.Core/ByteBuffer.cs
+++ b/src/DotRecast.Core/ByteBuffer.cs
@@ -1,7 +1,9 @@
using System;
using System.Buffers.Binary;
-namespace DotRecast.Core;
+namespace DotRecast.Core
+{
+
public class ByteBuffer
{
@@ -93,14 +95,16 @@ public class ByteBuffer
public float getFloat()
{
var span = ReadBytes(4);
- if (_order == ByteOrder.BIG_ENDIAN)
+ if (_order == ByteOrder.BIG_ENDIAN && BitConverter.IsLittleEndian)
{
- return BinaryPrimitives.ReadSingleBigEndian(span);
+ span.Reverse();
}
- else
+ else if (_order == ByteOrder.LITTLE_ENDIAN && !BitConverter.IsLittleEndian)
{
- return BinaryPrimitives.ReadSingleLittleEndian(span);
+ span.Reverse();
}
+
+ return BitConverter.ToSingle(span);
}
public long getLong()
@@ -125,4 +129,5 @@ public class ByteBuffer
{
// ?
}
+}
}
\ No newline at end of file
diff --git a/src/DotRecast.Core/ByteOrder.cs b/src/DotRecast.Core/ByteOrder.cs
index 4526da6..47ccdc9 100644
--- a/src/DotRecast.Core/ByteOrder.cs
+++ b/src/DotRecast.Core/ByteOrder.cs
@@ -1,8 +1,12 @@
-namespace DotRecast.Core;
+namespace DotRecast.Core
+{
+
public enum ByteOrder
{
/// Default on most Windows systems
LITTLE_ENDIAN,
BIG_ENDIAN,
+}
+
}
\ No newline at end of file
diff --git a/src/DotRecast.Core/CollectionExtensions.cs b/src/DotRecast.Core/CollectionExtensions.cs
index 904c4e9..70052d1 100644
--- a/src/DotRecast.Core/CollectionExtensions.cs
+++ b/src/DotRecast.Core/CollectionExtensions.cs
@@ -1,7 +1,9 @@
using System;
using System.Collections.Generic;
-namespace DotRecast.Core;
+namespace DotRecast.Core
+{
+
public static class CollectionExtensions
{
@@ -26,4 +28,5 @@ public static class CollectionExtensions
list[n] = value;
}
}
+}
}
\ No newline at end of file
diff --git a/src/DotRecast.Core/ConvexUtils.cs b/src/DotRecast.Core/ConvexUtils.cs
index 7b9f5c3..43b94ee 100644
--- a/src/DotRecast.Core/ConvexUtils.cs
+++ b/src/DotRecast.Core/ConvexUtils.cs
@@ -18,7 +18,9 @@ freely, subject to the following restrictions:
using System.Collections.Generic;
-namespace DotRecast.Core;
+namespace DotRecast.Core
+{
+
public static class ConvexUtils {
@@ -27,7 +29,7 @@ public static class ConvexUtils {
// returns number of points on hull.
public static List convexhull(List pts) {
int npts = pts.Count / 3;
- List @out = new();
+ List @out = new List();
// Find lower-leftmost point.
int hull = 0;
for (int i = 1; i < npts; ++i) {
@@ -83,3 +85,5 @@ public static class ConvexUtils {
}
}
+
+}
\ No newline at end of file
diff --git a/src/DotRecast.Core/DemoMath.cs b/src/DotRecast.Core/DemoMath.cs
index 5c789d5..3479c92 100644
--- a/src/DotRecast.Core/DemoMath.cs
+++ b/src/DotRecast.Core/DemoMath.cs
@@ -20,7 +20,9 @@ freely, subject to the following restrictions:
using System;
-namespace DotRecast.Core;
+namespace DotRecast.Core
+{
+
public class DemoMath {
public static float vDistSqr(float[] v1, float[] v2, int i) {
@@ -77,3 +79,5 @@ public class DemoMath {
return u * g + (1f - u) * f;
}
}
+
+}
\ No newline at end of file
diff --git a/src/DotRecast.Core/DotRecast.Core.csproj b/src/DotRecast.Core/DotRecast.Core.csproj
index 57bdec1..c44e729 100644
--- a/src/DotRecast.Core/DotRecast.Core.csproj
+++ b/src/DotRecast.Core/DotRecast.Core.csproj
@@ -1,9 +1,12 @@
- net7.0
-
-
+ netstandard2.1
+
+
+
+
+
diff --git a/src/DotRecast.Core/Loader.cs b/src/DotRecast.Core/Loader.cs
index 2d40ccd..c9e8da0 100644
--- a/src/DotRecast.Core/Loader.cs
+++ b/src/DotRecast.Core/Loader.cs
@@ -1,6 +1,8 @@
using System.IO;
-namespace DotRecast.Core;
+namespace DotRecast.Core
+{
+
public static class Loader
{
@@ -29,4 +31,5 @@ public static class Loader
return filename;
}
+}
}
\ No newline at end of file
diff --git a/src/DotRecast.Core/NodeQueue.cs b/src/DotRecast.Core/NodeQueue.cs
index caec267..469d461 100644
--- a/src/DotRecast.Core/NodeQueue.cs
+++ b/src/DotRecast.Core/NodeQueue.cs
@@ -20,7 +20,9 @@ freely, subject to the following restrictions:
using System;
-namespace DotRecast.Core;
+namespace DotRecast.Core
+{
+
using System.Collections.Generic;
@@ -32,7 +34,7 @@ public class OrderedQueue
public OrderedQueue(Comparison comparison)
{
- _items = new();
+ _items = new List();
_comparison = comparison;
}
@@ -71,3 +73,5 @@ public class OrderedQueue
return 0 == _items.Count;
}
}
+
+}
\ No newline at end of file
diff --git a/src/DotRecast.Detour.Crowd/Crowd.cs b/src/DotRecast.Detour.Crowd/Crowd.cs
index 0b25bb7..c8d8de9 100644
--- a/src/DotRecast.Detour.Crowd/Crowd.cs
+++ b/src/DotRecast.Detour.Crowd/Crowd.cs
@@ -25,7 +25,9 @@ using System.Collections.ObjectModel;
using DotRecast.Core;
using DotRecast.Detour.Crowd.Tracking;
-namespace DotRecast.Detour.Crowd;
+namespace DotRecast.Detour.Crowd
+{
+
using static DetourCommon;
@@ -177,7 +179,7 @@ public class Crowd {
// Allocate temp buffer for merging paths.
m_pathq = new PathQueue(config);
- m_agents = new();
+ m_agents = new HashSet();
// The navQuery is mostly used for local searches, no need for large node pool.
navMesh = nav;
@@ -334,7 +336,7 @@ public class Crowd {
* @return List of active agents
*/
public List getActiveAgents() {
- return new(m_agents);
+ return new List(m_agents);
}
public float[] getQueryExtents() {
@@ -516,7 +518,7 @@ public class Crowd {
private void updateMoveRequest(ICollection agents, float dt) {
_telemetry.start("updateMoveRequest");
- OrderedQueue queue = new((a1, a2) => a2.targetReplanTime.CompareTo(a1.targetReplanTime));
+ OrderedQueue queue = new OrderedQueue((a1, a2) => a2.targetReplanTime.CompareTo(a1.targetReplanTime));
// Fire off new requests.
foreach (CrowdAgent ag in agents) {
@@ -559,7 +561,7 @@ public class Crowd {
if (cr.succeeded()) {
reqPos = cr.result.getClosest();
} else {
- reqPath = new();
+ reqPath = new List();
}
} else {
vCopy(reqPos, ag.targetPos);
@@ -568,7 +570,7 @@ public class Crowd {
// Could not find path, start the request from current
// location.
vCopy(reqPos, ag.npos);
- reqPath = new();
+ reqPath = new List();
reqPath.Add(path[0]);
}
@@ -717,7 +719,7 @@ public class Crowd {
private void updateTopologyOptimization(ICollection agents, float dt) {
_telemetry.start("updateTopologyOptimization");
- OrderedQueue queue = new((a1, a2) => a2.topologyOptTime.CompareTo(a1.topologyOptTime));
+ OrderedQueue queue = new OrderedQueue((a1, a2) => a2.topologyOptTime.CompareTo(a1.topologyOptTime));
foreach (CrowdAgent ag in agents) {
if (ag.state != CrowdAgent.CrowdAgentState.DT_CROWDAGENT_STATE_WALKING) {
@@ -779,7 +781,7 @@ public class Crowd {
private List getNeighbours(float[] pos, float height, float range, CrowdAgent skip, ProximityGrid grid) {
- List result = new();
+ List result = new List();
HashSet proxAgents = grid.queryItems(pos[0] - range, pos[2] - range, pos[0] + range, pos[2] + range);
foreach (CrowdAgent ag in proxAgents) {
@@ -1170,3 +1172,5 @@ public class Crowd {
};
}
+
+}
\ No newline at end of file
diff --git a/src/DotRecast.Detour.Crowd/CrowdAgent.cs b/src/DotRecast.Detour.Crowd/CrowdAgent.cs
index 9fe3e0e..88d45d3 100644
--- a/src/DotRecast.Detour.Crowd/CrowdAgent.cs
+++ b/src/DotRecast.Detour.Crowd/CrowdAgent.cs
@@ -21,7 +21,9 @@ freely, subject to the following restrictions:
using System;
using System.Collections.Generic;
-namespace DotRecast.Detour.Crowd;
+namespace DotRecast.Detour.Crowd
+{
+
using static DetourCommon;
@@ -60,7 +62,7 @@ public class CrowdAgent {
/// Time since the agent's path corridor was optimized.
public float topologyOptTime;
/// The known neighbors of the agent.
- public List neis = new();
+ public List neis = new List();
/// The desired speed.
public float desiredSpeed;
@@ -78,7 +80,7 @@ public class CrowdAgent {
/// The agent's configuration parameters.
public CrowdAgentParams option;
/// The local path corridor corners for the agent.
- public List corners = new();
+ public List corners = new List();
public MoveRequestState targetState; /// < State of the movement request.
public long targetRef; /// < Target polyref of the movement request.
@@ -189,4 +191,5 @@ public class CrowdAgent {
}
}
+}
}
\ No newline at end of file
diff --git a/src/DotRecast.Detour.Crowd/CrowdAgentAnimation.cs b/src/DotRecast.Detour.Crowd/CrowdAgentAnimation.cs
index 43757f7..208aa41 100644
--- a/src/DotRecast.Detour.Crowd/CrowdAgentAnimation.cs
+++ b/src/DotRecast.Detour.Crowd/CrowdAgentAnimation.cs
@@ -17,7 +17,9 @@ freely, subject to the following restrictions:
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
-namespace DotRecast.Detour.Crowd;
+namespace DotRecast.Detour.Crowd
+{
+
public class CrowdAgentAnimation {
public bool active;
@@ -28,3 +30,5 @@ public class CrowdAgentAnimation {
public float t, tmax;
}
+
+}
\ No newline at end of file
diff --git a/src/DotRecast.Detour.Crowd/CrowdAgentParams.cs b/src/DotRecast.Detour.Crowd/CrowdAgentParams.cs
index 0011714..a495dfa 100644
--- a/src/DotRecast.Detour.Crowd/CrowdAgentParams.cs
+++ b/src/DotRecast.Detour.Crowd/CrowdAgentParams.cs
@@ -20,7 +20,9 @@ freely, subject to the following restrictions:
using System;
-namespace DotRecast.Detour.Crowd;
+namespace DotRecast.Detour.Crowd
+{
+
/// Configuration parameters for a crowd agent.
/// @ingroup crowd
@@ -59,4 +61,5 @@ public class CrowdAgentParams {
/// User defined data attached to the agent.
public object userData;
+}
}
\ No newline at end of file
diff --git a/src/DotRecast.Detour.Crowd/CrowdConfig.cs b/src/DotRecast.Detour.Crowd/CrowdConfig.cs
index ba2e715..16c68cb 100644
--- a/src/DotRecast.Detour.Crowd/CrowdConfig.cs
+++ b/src/DotRecast.Detour.Crowd/CrowdConfig.cs
@@ -16,7 +16,9 @@ freely, subject to the following restrictions:
3. This notice may not be removed or altered from any source distribution.
*/
-namespace DotRecast.Detour.Crowd;
+namespace DotRecast.Detour.Crowd
+{
+
public class CrowdConfig {
@@ -64,3 +66,5 @@ public class CrowdConfig {
}
}
+
+}
\ No newline at end of file
diff --git a/src/DotRecast.Detour.Crowd/CrowdTelemetry.cs b/src/DotRecast.Detour.Crowd/CrowdTelemetry.cs
index 0d20e5e..22741ad 100644
--- a/src/DotRecast.Detour.Crowd/CrowdTelemetry.cs
+++ b/src/DotRecast.Detour.Crowd/CrowdTelemetry.cs
@@ -21,7 +21,9 @@ using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
-namespace DotRecast.Detour.Crowd;
+namespace DotRecast.Detour.Crowd
+{
+
public class CrowdTelemetry {
@@ -29,8 +31,8 @@ public class CrowdTelemetry {
public const int TIMING_SAMPLES = 10;
private float _maxTimeToEnqueueRequest;
private float _maxTimeToFindPath;
- private readonly Dictionary _executionTimings = new();
- private readonly Dictionary> _executionTimingSamples = new();
+ private readonly Dictionary _executionTimings = new Dictionary();
+ private readonly Dictionary> _executionTimingSamples = new Dictionary>();
public float maxTimeToEnqueueRequest() {
return _maxTimeToEnqueueRequest;
@@ -66,7 +68,7 @@ public class CrowdTelemetry {
long duration = Stopwatch.GetTimestamp() - _executionTimings[name];
if (!_executionTimingSamples.TryGetValue(name, out var s))
{
- s = new();
+ s = new List();
_executionTimingSamples.Add(name, s);
}
@@ -77,3 +79,5 @@ public class CrowdTelemetry {
_executionTimings[name] = (long) s.Average();
}
}
+
+}
\ No newline at end of file
diff --git a/src/DotRecast.Detour.Crowd/DotRecast.Detour.Crowd.csproj b/src/DotRecast.Detour.Crowd/DotRecast.Detour.Crowd.csproj
index 29df87b..3188170 100644
--- a/src/DotRecast.Detour.Crowd/DotRecast.Detour.Crowd.csproj
+++ b/src/DotRecast.Detour.Crowd/DotRecast.Detour.Crowd.csproj
@@ -1,7 +1,7 @@
- net7.0
+ netstandard2.1
diff --git a/src/DotRecast.Detour.Crowd/LocalBoundary.cs b/src/DotRecast.Detour.Crowd/LocalBoundary.cs
index 5e372d4..f2b083b 100644
--- a/src/DotRecast.Detour.Crowd/LocalBoundary.cs
+++ b/src/DotRecast.Detour.Crowd/LocalBoundary.cs
@@ -21,7 +21,9 @@ freely, subject to the following restrictions:
using System;
using System.Collections.Generic;
-namespace DotRecast.Detour.Crowd;
+namespace DotRecast.Detour.Crowd
+{
+
using static DetourCommon;
@@ -37,8 +39,8 @@ public class LocalBoundary {
}
float[] m_center = new float[3];
- List m_segs = new();
- List m_polys = new();
+ List m_segs = new List();
+ List m_polys = new List();
public LocalBoundary() {
m_center[0] = m_center[1] = m_center[2] = float.MaxValue;
@@ -135,3 +137,5 @@ public class LocalBoundary {
return m_segs.Count;
}
}
+
+}
\ No newline at end of file
diff --git a/src/DotRecast.Detour.Crowd/ObstacleAvoidanceQuery.cs b/src/DotRecast.Detour.Crowd/ObstacleAvoidanceQuery.cs
index 411693a..956718d 100644
--- a/src/DotRecast.Detour.Crowd/ObstacleAvoidanceQuery.cs
+++ b/src/DotRecast.Detour.Crowd/ObstacleAvoidanceQuery.cs
@@ -21,7 +21,9 @@ freely, subject to the following restrictions:
using System;
using DotRecast.Detour.Crowd.Tracking;
-namespace DotRecast.Detour.Crowd;
+namespace DotRecast.Detour.Crowd
+{
+
using static DetourCommon;
@@ -507,3 +509,5 @@ public class ObstacleAvoidanceQuery {
return Tuple.Create(ns, nvel);
}
}
+
+}
\ No newline at end of file
diff --git a/src/DotRecast.Detour.Crowd/PathCorridor.cs b/src/DotRecast.Detour.Crowd/PathCorridor.cs
index 865542e..e01458d 100644
--- a/src/DotRecast.Detour.Crowd/PathCorridor.cs
+++ b/src/DotRecast.Detour.Crowd/PathCorridor.cs
@@ -21,7 +21,9 @@ freely, subject to the following restrictions:
using System;
using System.Collections.Generic;
-namespace DotRecast.Detour.Crowd;
+namespace DotRecast.Detour.Crowd
+{
+
using static DetourCommon;
@@ -95,7 +97,7 @@ public class PathCorridor {
// Concatenate paths.
// Adjust beginning of the buffer to include the visited.
- List result = new();
+ List result = new List();
// Store visited
for (int i = visited.Count - 1; i > furthestVisited; --i) {
result.Add(visited[i]);
@@ -171,7 +173,7 @@ public class PathCorridor {
* Allocates the corridor's path buffer.
*/
public PathCorridor() {
- m_path = new();
+ m_path = new List();
}
/**
@@ -209,7 +211,7 @@ public class PathCorridor {
* @return Corners
*/
public List findCorners(int maxCorners, NavMeshQuery navquery, QueryFilter filter) {
- List path = new();
+ List path = new List();
Result> result = navquery.findStraightPath(m_pos, m_target, m_path, maxCorners, 0);
if (result.succeeded()) {
path = result.result;
@@ -441,7 +443,7 @@ public class PathCorridor {
public void setCorridor(float[] target, List path) {
vCopy(m_target, target);
- m_path = new(path);
+ m_path = new List(path);
}
public void fixPathStart(long safeRef, float[] safePos) {
@@ -560,3 +562,5 @@ public class PathCorridor {
return m_path.Count;
}
}
+
+}
\ No newline at end of file
diff --git a/src/DotRecast.Detour.Crowd/PathQuery.cs b/src/DotRecast.Detour.Crowd/PathQuery.cs
index c8b77a6..a1ffa1e 100644
--- a/src/DotRecast.Detour.Crowd/PathQuery.cs
+++ b/src/DotRecast.Detour.Crowd/PathQuery.cs
@@ -17,7 +17,9 @@ freely, subject to the following restrictions:
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
-namespace DotRecast.Detour.Crowd;
+namespace DotRecast.Detour.Crowd
+{
+
public class PathQuery {
/// Path find start and end location.
@@ -30,3 +32,5 @@ public class PathQuery {
public NavMeshQuery navQuery;
}
+
+}
\ No newline at end of file
diff --git a/src/DotRecast.Detour.Crowd/PathQueryResult.cs b/src/DotRecast.Detour.Crowd/PathQueryResult.cs
index 6b6efbe..45546be 100644
--- a/src/DotRecast.Detour.Crowd/PathQueryResult.cs
+++ b/src/DotRecast.Detour.Crowd/PathQueryResult.cs
@@ -18,9 +18,13 @@ freely, subject to the following restrictions:
using System.Collections.Generic;
-namespace DotRecast.Detour.Crowd;
+namespace DotRecast.Detour.Crowd
+{
+
public class PathQueryResult {
public Status status;
- public List path = new();
+ public List path = new List();
}
+
+}
\ No newline at end of file
diff --git a/src/DotRecast.Detour.Crowd/PathQueue.cs b/src/DotRecast.Detour.Crowd/PathQueue.cs
index 4be599f..4a664fb 100644
--- a/src/DotRecast.Detour.Crowd/PathQueue.cs
+++ b/src/DotRecast.Detour.Crowd/PathQueue.cs
@@ -20,14 +20,16 @@ freely, subject to the following restrictions:
using System.Collections.Generic;
-namespace DotRecast.Detour.Crowd;
+namespace DotRecast.Detour.Crowd
+{
+
using static DetourCommon;
public class PathQueue {
private readonly CrowdConfig config;
- private readonly LinkedList queue = new();
+ private readonly LinkedList queue = new LinkedList();
public PathQueue(CrowdConfig config) {
this.config = config;
@@ -81,3 +83,5 @@ public class PathQueue {
}
}
+
+}
\ No newline at end of file
diff --git a/src/DotRecast.Detour.Crowd/ProximityGrid.cs b/src/DotRecast.Detour.Crowd/ProximityGrid.cs
index 68c71b9..e11f954 100644
--- a/src/DotRecast.Detour.Crowd/ProximityGrid.cs
+++ b/src/DotRecast.Detour.Crowd/ProximityGrid.cs
@@ -22,7 +22,9 @@ using System;
using System.Collections.Generic;
using System.Linq;
-namespace DotRecast.Detour.Crowd;
+namespace DotRecast.Detour.Crowd
+{
+
public class ProximityGrid {
@@ -33,7 +35,7 @@ public class ProximityGrid {
public ProximityGrid(float m_cellSize) {
this.m_cellSize = m_cellSize;
m_invCellSize = 1.0f / m_cellSize;
- items = new();
+ items = new Dictionary>();
}
void clear() {
@@ -50,7 +52,7 @@ public class ProximityGrid {
for (int x = iminx; x <= imaxx; ++x) {
ItemKey key = new ItemKey(x, y);
if (!items.TryGetValue(key, out var ids)) {
- ids = new();
+ ids = new List();
items.Add(key, ids);
}
ids.Add(agent);
@@ -64,7 +66,7 @@ public class ProximityGrid {
int imaxx = (int) Math.Floor(maxx * m_invCellSize);
int imaxy = (int) Math.Floor(maxy * m_invCellSize);
- HashSet result = new();
+ HashSet result = new HashSet();
for (int y = iminy; y <= imaxy; ++y) {
for (int x = iminx; x <= imaxx; ++x) {
ItemKey key = new ItemKey(x, y);
@@ -128,3 +130,5 @@ public class ProximityGrid {
};
}
+
+}
\ No newline at end of file
diff --git a/src/DotRecast.Detour.Crowd/SweepCircleCircleResult.cs b/src/DotRecast.Detour.Crowd/SweepCircleCircleResult.cs
index 84536ff..409f12d 100644
--- a/src/DotRecast.Detour.Crowd/SweepCircleCircleResult.cs
+++ b/src/DotRecast.Detour.Crowd/SweepCircleCircleResult.cs
@@ -17,7 +17,9 @@ freely, subject to the following restrictions:
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
-namespace DotRecast.Detour.Crowd;
+namespace DotRecast.Detour.Crowd
+{
+
public class SweepCircleCircleResult {
@@ -32,3 +34,5 @@ public class SweepCircleCircleResult {
}
}
+
+}
\ No newline at end of file
diff --git a/src/DotRecast.Detour.Crowd/Tracking/CrowdAgentDebugInfo.cs b/src/DotRecast.Detour.Crowd/Tracking/CrowdAgentDebugInfo.cs
index 49f6e3a..fa4d54e 100644
--- a/src/DotRecast.Detour.Crowd/Tracking/CrowdAgentDebugInfo.cs
+++ b/src/DotRecast.Detour.Crowd/Tracking/CrowdAgentDebugInfo.cs
@@ -17,7 +17,9 @@ freely, subject to the following restrictions:
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
-namespace DotRecast.Detour.Crowd.Tracking;
+namespace DotRecast.Detour.Crowd.Tracking
+{
+
public class CrowdAgentDebugInfo {
@@ -27,3 +29,5 @@ public class CrowdAgentDebugInfo {
public ObstacleAvoidanceDebugData vod;
}
+
+}
\ No newline at end of file
diff --git a/src/DotRecast.Detour.Crowd/Tracking/ObstacleAvoidanceDebugData.cs b/src/DotRecast.Detour.Crowd/Tracking/ObstacleAvoidanceDebugData.cs
index ebd4519..d75974e 100644
--- a/src/DotRecast.Detour.Crowd/Tracking/ObstacleAvoidanceDebugData.cs
+++ b/src/DotRecast.Detour.Crowd/Tracking/ObstacleAvoidanceDebugData.cs
@@ -20,7 +20,9 @@ freely, subject to the following restrictions:
using System;
-namespace DotRecast.Detour.Crowd.Tracking;
+namespace DotRecast.Detour.Crowd.Tracking
+{
+
using static DetourCommon;
@@ -122,4 +124,5 @@ public class ObstacleAvoidanceDebugData {
public float getSampleCollisionTimePenalty(int i) {
return m_tpen[i];
}
+}
}
\ No newline at end of file
diff --git a/src/DotRecast.Detour.Dynamic/AddColliderQueueItem.cs b/src/DotRecast.Detour.Dynamic/AddColliderQueueItem.cs
index 4afa6e3..99c1946 100644
--- a/src/DotRecast.Detour.Dynamic/AddColliderQueueItem.cs
+++ b/src/DotRecast.Detour.Dynamic/AddColliderQueueItem.cs
@@ -19,7 +19,9 @@ freely, subject to the following restrictions:
using System.Collections.Generic;
using DotRecast.Detour.Dynamic.Colliders;
-namespace DotRecast.Detour.Dynamic;
+namespace DotRecast.Detour.Dynamic
+{
+
public class AddColliderQueueItem : UpdateQueueItem {
@@ -42,3 +44,5 @@ public class AddColliderQueueItem : UpdateQueueItem {
}
}
+
+}
\ No newline at end of file
diff --git a/src/DotRecast.Detour.Dynamic/Colliders/AbstractCollider.cs b/src/DotRecast.Detour.Dynamic/Colliders/AbstractCollider.cs
index 2773f61..ad4ccb4 100644
--- a/src/DotRecast.Detour.Dynamic/Colliders/AbstractCollider.cs
+++ b/src/DotRecast.Detour.Dynamic/Colliders/AbstractCollider.cs
@@ -18,7 +18,9 @@ freely, subject to the following restrictions:
using DotRecast.Recast;
-namespace DotRecast.Detour.Dynamic.Colliders;
+namespace DotRecast.Detour.Dynamic.Colliders
+{
+
public abstract class AbstractCollider : Collider {
@@ -42,3 +44,5 @@ public abstract class AbstractCollider : Collider {
}
}
+
+}
\ No newline at end of file
diff --git a/src/DotRecast.Detour.Dynamic/Colliders/BoxCollider.cs b/src/DotRecast.Detour.Dynamic/Colliders/BoxCollider.cs
index 9ec35ad..c3308e5 100644
--- a/src/DotRecast.Detour.Dynamic/Colliders/BoxCollider.cs
+++ b/src/DotRecast.Detour.Dynamic/Colliders/BoxCollider.cs
@@ -19,7 +19,9 @@ freely, subject to the following restrictions:
using System;
using DotRecast.Recast;
-namespace DotRecast.Detour.Dynamic.Colliders;
+namespace DotRecast.Detour.Dynamic.Colliders
+{
+
public class BoxCollider : AbstractCollider {
@@ -77,3 +79,5 @@ public class BoxCollider : AbstractCollider {
}
}
+
+}
\ No newline at end of file
diff --git a/src/DotRecast.Detour.Dynamic/Colliders/CapsuleCollider.cs b/src/DotRecast.Detour.Dynamic/Colliders/CapsuleCollider.cs
index 311af6f..14ccdf0 100644
--- a/src/DotRecast.Detour.Dynamic/Colliders/CapsuleCollider.cs
+++ b/src/DotRecast.Detour.Dynamic/Colliders/CapsuleCollider.cs
@@ -19,7 +19,9 @@ freely, subject to the following restrictions:
using System;
using DotRecast.Recast;
-namespace DotRecast.Detour.Dynamic.Colliders;
+namespace DotRecast.Detour.Dynamic.Colliders
+{
+
public class CapsuleCollider : AbstractCollider {
@@ -47,3 +49,5 @@ public class CapsuleCollider : AbstractCollider {
}
}
+
+}
\ No newline at end of file
diff --git a/src/DotRecast.Detour.Dynamic/Colliders/Collider.cs b/src/DotRecast.Detour.Dynamic/Colliders/Collider.cs
index 292ff34..b14e58e 100644
--- a/src/DotRecast.Detour.Dynamic/Colliders/Collider.cs
+++ b/src/DotRecast.Detour.Dynamic/Colliders/Collider.cs
@@ -18,10 +18,14 @@ freely, subject to the following restrictions:
using DotRecast.Recast;
-namespace DotRecast.Detour.Dynamic.Colliders;
+namespace DotRecast.Detour.Dynamic.Colliders
+{
+
public interface Collider {
float[] bounds();
void rasterize(Heightfield hf, Telemetry telemetry);
}
+
+}
\ No newline at end of file
diff --git a/src/DotRecast.Detour.Dynamic/Colliders/CompositeCollider.cs b/src/DotRecast.Detour.Dynamic/Colliders/CompositeCollider.cs
index 1234b94..b422865 100644
--- a/src/DotRecast.Detour.Dynamic/Colliders/CompositeCollider.cs
+++ b/src/DotRecast.Detour.Dynamic/Colliders/CompositeCollider.cs
@@ -21,7 +21,9 @@ using System.Collections.Generic;
using System.Linq;
using DotRecast.Recast;
-namespace DotRecast.Detour.Dynamic.Colliders;
+namespace DotRecast.Detour.Dynamic.Colliders
+{
+
public class CompositeCollider : Collider {
@@ -63,3 +65,5 @@ public class CompositeCollider : Collider {
}
}
+
+}
\ No newline at end of file
diff --git a/src/DotRecast.Detour.Dynamic/Colliders/ConvexTrimeshCollider.cs b/src/DotRecast.Detour.Dynamic/Colliders/ConvexTrimeshCollider.cs
index 4766960..641dbae 100644
--- a/src/DotRecast.Detour.Dynamic/Colliders/ConvexTrimeshCollider.cs
+++ b/src/DotRecast.Detour.Dynamic/Colliders/ConvexTrimeshCollider.cs
@@ -19,7 +19,9 @@ freely, subject to the following restrictions:
using System;
using DotRecast.Recast;
-namespace DotRecast.Detour.Dynamic.Colliders;
+namespace DotRecast.Detour.Dynamic.Colliders
+{
+
public class ConvexTrimeshCollider : AbstractCollider {
@@ -44,3 +46,5 @@ public class ConvexTrimeshCollider : AbstractCollider {
}
}
+
+}
\ No newline at end of file
diff --git a/src/DotRecast.Detour.Dynamic/Colliders/CylinderCollider.cs b/src/DotRecast.Detour.Dynamic/Colliders/CylinderCollider.cs
index 04e529a..15550eb 100644
--- a/src/DotRecast.Detour.Dynamic/Colliders/CylinderCollider.cs
+++ b/src/DotRecast.Detour.Dynamic/Colliders/CylinderCollider.cs
@@ -19,7 +19,9 @@ freely, subject to the following restrictions:
using System;
using DotRecast.Recast;
-namespace DotRecast.Detour.Dynamic.Colliders;
+namespace DotRecast.Detour.Dynamic.Colliders
+{
+
public class CylinderCollider : AbstractCollider {
@@ -46,3 +48,5 @@ public class CylinderCollider : AbstractCollider {
}
}
+
+}
\ No newline at end of file
diff --git a/src/DotRecast.Detour.Dynamic/Colliders/SphereCollider.cs b/src/DotRecast.Detour.Dynamic/Colliders/SphereCollider.cs
index 7b8f58f..795f957 100644
--- a/src/DotRecast.Detour.Dynamic/Colliders/SphereCollider.cs
+++ b/src/DotRecast.Detour.Dynamic/Colliders/SphereCollider.cs
@@ -19,7 +19,9 @@ freely, subject to the following restrictions:
using System;
using DotRecast.Recast;
-namespace DotRecast.Detour.Dynamic.Colliders;
+namespace DotRecast.Detour.Dynamic.Colliders
+{
+
public class SphereCollider : AbstractCollider {
@@ -43,3 +45,5 @@ public class SphereCollider : AbstractCollider {
}
}
+
+}
\ No newline at end of file
diff --git a/src/DotRecast.Detour.Dynamic/Colliders/TrimeshCollider.cs b/src/DotRecast.Detour.Dynamic/Colliders/TrimeshCollider.cs
index 4e4a485..c3e3fa0 100644
--- a/src/DotRecast.Detour.Dynamic/Colliders/TrimeshCollider.cs
+++ b/src/DotRecast.Detour.Dynamic/Colliders/TrimeshCollider.cs
@@ -19,7 +19,9 @@ freely, subject to the following restrictions:
using System;
using DotRecast.Recast;
-namespace DotRecast.Detour.Dynamic.Colliders;
+namespace DotRecast.Detour.Dynamic.Colliders
+{
+
public class TrimeshCollider : AbstractCollider {
@@ -59,3 +61,5 @@ public class TrimeshCollider : AbstractCollider {
}
}
+
+}
\ No newline at end of file
diff --git a/src/DotRecast.Detour.Dynamic/DotRecast.Detour.Dynamic.csproj b/src/DotRecast.Detour.Dynamic/DotRecast.Detour.Dynamic.csproj
index d9f14b1..fd2bf2d 100644
--- a/src/DotRecast.Detour.Dynamic/DotRecast.Detour.Dynamic.csproj
+++ b/src/DotRecast.Detour.Dynamic/DotRecast.Detour.Dynamic.csproj
@@ -1,7 +1,7 @@
- net7.0
+ netstandard2.1
diff --git a/src/DotRecast.Detour.Dynamic/DynamicNavMesh.cs b/src/DotRecast.Detour.Dynamic/DynamicNavMesh.cs
index 4c34119..872c3ab 100644
--- a/src/DotRecast.Detour.Dynamic/DynamicNavMesh.cs
+++ b/src/DotRecast.Detour.Dynamic/DynamicNavMesh.cs
@@ -27,17 +27,19 @@ using DotRecast.Detour.Dynamic.Colliders;
using DotRecast.Detour.Dynamic.Io;
using DotRecast.Recast;
-namespace DotRecast.Detour.Dynamic;
+namespace DotRecast.Detour.Dynamic
+{
+
public class DynamicNavMesh {
public const int MAX_VERTS_PER_POLY = 6;
public readonly DynamicNavMeshConfig config;
private readonly RecastBuilder builder;
- private readonly Dictionary _tiles = new();
+ private readonly Dictionary _tiles = new Dictionary();
private readonly Telemetry telemetry;
private readonly NavMeshParams navMeshParams;
- private readonly BlockingCollection updateQueue = new();
+ private readonly BlockingCollection updateQueue = new BlockingCollection();
private readonly AtomicLong currentColliderId = new AtomicLong(0);
private NavMesh _navMesh;
private bool dirty = true;
@@ -127,7 +129,7 @@ public class DynamicNavMesh {
}
private List consumeQueue() {
- List items = new();
+ List items = new List();
while (updateQueue.TryTake(out var item)) {
items.Add(item);
}
@@ -170,7 +172,7 @@ public class DynamicNavMesh {
int minz = (int) Math.Floor((bounds[2] - navMeshParams.orig[2]) / navMeshParams.tileHeight);
int maxx = (int) Math.Floor((bounds[3] - navMeshParams.orig[0]) / navMeshParams.tileWidth);
int maxz = (int) Math.Floor((bounds[5] - navMeshParams.orig[2]) / navMeshParams.tileHeight);
- List tiles = new();
+ List tiles = new List();
for (int z = minz; z <= maxz; ++z) {
for (int x = minx; x <= maxx; ++x) {
DynamicTile tile = getTileAt(x, z);
@@ -224,3 +226,5 @@ public class DynamicNavMesh {
}
}
+
+}
\ No newline at end of file
diff --git a/src/DotRecast.Detour.Dynamic/DynamicNavMeshConfig.cs b/src/DotRecast.Detour.Dynamic/DynamicNavMeshConfig.cs
index 86804ef..ab4deb1 100644
--- a/src/DotRecast.Detour.Dynamic/DynamicNavMeshConfig.cs
+++ b/src/DotRecast.Detour.Dynamic/DynamicNavMeshConfig.cs
@@ -18,7 +18,9 @@ freely, subject to the following restrictions:
using DotRecast.Recast;
-namespace DotRecast.Detour.Dynamic;
+namespace DotRecast.Detour.Dynamic
+{
+
public class DynamicNavMeshConfig {
@@ -54,3 +56,5 @@ public class DynamicNavMeshConfig {
}
}
+
+}
\ No newline at end of file
diff --git a/src/DotRecast.Detour.Dynamic/DynamicTile.cs b/src/DotRecast.Detour.Dynamic/DynamicTile.cs
index 09bb2aa..8dad26d 100644
--- a/src/DotRecast.Detour.Dynamic/DynamicTile.cs
+++ b/src/DotRecast.Detour.Dynamic/DynamicTile.cs
@@ -20,13 +20,14 @@ using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Collections.Immutable;
-using System.Collections.ObjectModel;
using System.Linq;
using DotRecast.Detour.Dynamic.Colliders;
using DotRecast.Detour.Dynamic.Io;
using DotRecast.Recast;
-namespace DotRecast.Detour.Dynamic;
+namespace DotRecast.Detour.Dynamic
+{
+
public class DynamicTile {
@@ -34,7 +35,7 @@ public class DynamicTile {
public DynamicTileCheckpoint checkpoint;
public RecastBuilderResult recastResult;
MeshData meshData;
- private readonly ConcurrentDictionary colliders = new();
+ private readonly ConcurrentDictionary colliders = new ConcurrentDictionary();
private bool dirty = true;
private long id;
@@ -55,7 +56,7 @@ public class DynamicTile {
}
private Heightfield buildHeightfield(DynamicNavMeshConfig config, Telemetry telemetry) {
- ICollection rasterizedColliders = checkpoint != null ? checkpoint.colliders : ImmutableArray.Empty;
+ ICollection rasterizedColliders = checkpoint != null ? checkpoint.colliders : ImmutableHashSet.Empty;
Heightfield heightfield = checkpoint != null ? checkpoint.heightfield : voxelTile.heightfield();
foreach (var (cid, c) in colliders) {
if (!rasterizedColliders.Contains(cid)) {
@@ -152,3 +153,5 @@ public class DynamicTile {
}
}
}
+
+}
\ No newline at end of file
diff --git a/src/DotRecast.Detour.Dynamic/DynamicTileCheckpoint.cs b/src/DotRecast.Detour.Dynamic/DynamicTileCheckpoint.cs
index d6fb09e..70e79f5 100644
--- a/src/DotRecast.Detour.Dynamic/DynamicTileCheckpoint.cs
+++ b/src/DotRecast.Detour.Dynamic/DynamicTileCheckpoint.cs
@@ -21,7 +21,9 @@ using DotRecast.Recast;
using static DotRecast.Detour.DetourCommon;
-namespace DotRecast.Detour.Dynamic;
+namespace DotRecast.Detour.Dynamic
+{
+
public class DynamicTileCheckpoint {
@@ -59,3 +61,5 @@ public class DynamicTileCheckpoint {
}
}
+
+}
\ No newline at end of file
diff --git a/src/DotRecast.Detour.Dynamic/Io/ByteUtils.cs b/src/DotRecast.Detour.Dynamic/Io/ByteUtils.cs
index 1bc77ac..b052a85 100644
--- a/src/DotRecast.Detour.Dynamic/Io/ByteUtils.cs
+++ b/src/DotRecast.Detour.Dynamic/Io/ByteUtils.cs
@@ -18,7 +18,9 @@ freely, subject to the following restrictions:
using DotRecast.Core;
-namespace DotRecast.Detour.Dynamic.Io;
+namespace DotRecast.Detour.Dynamic.Io
+{
+
public static class ByteUtils {
@@ -50,28 +52,30 @@ public static class ByteUtils {
public static int putInt(int value, byte[] data, int position, ByteOrder order) {
if (order == ByteOrder.BIG_ENDIAN) {
- data[position] = (byte) (value >>> 24);
- data[position + 1] = (byte) (value >>> 16);
- data[position + 2] = (byte) (value >>> 8);
+ data[position] = (byte) ((uint)value >> 24);
+ data[position + 1] = (byte) ((uint)value >> 16);
+ data[position + 2] = (byte) ((uint)value >> 8);
data[position + 3] = (byte) (value & 0xFF);
} else {
data[position] = (byte) (value & 0xFF);
- data[position + 1] = (byte) (value >>> 8);
- data[position + 2] = (byte) (value >>> 16);
- data[position + 3] = (byte) (value >>> 24);
+ data[position + 1] = (byte) ((uint)value >> 8);
+ data[position + 2] = (byte) ((uint)value >> 16);
+ data[position + 3] = (byte) ((uint)value >> 24);
}
return position + 4;
}
public static int putShort(int value, byte[] data, int position, ByteOrder order) {
if (order == ByteOrder.BIG_ENDIAN) {
- data[position] = (byte) (value >>> 8);
+ data[position] = (byte) ((uint)value >> 8);
data[position + 1] = (byte) (value & 0xFF);
} else {
data[position] = (byte) (value & 0xFF);
- data[position + 1] = (byte) (value >>> 8);
+ data[position + 1] = (byte) ((uint)value >> 8);
}
return position + 2;
}
}
+
+}
\ No newline at end of file
diff --git a/src/DotRecast.Detour.Dynamic/Io/LZ4VoxelTileCompressor.cs b/src/DotRecast.Detour.Dynamic/Io/LZ4VoxelTileCompressor.cs
index 7f10288..fe59c35 100644
--- a/src/DotRecast.Detour.Dynamic/Io/LZ4VoxelTileCompressor.cs
+++ b/src/DotRecast.Detour.Dynamic/Io/LZ4VoxelTileCompressor.cs
@@ -20,7 +20,9 @@ using System;
using DotRecast.Core;
using K4os.Compression.LZ4;
-namespace DotRecast.Detour.Dynamic.Io;
+namespace DotRecast.Detour.Dynamic.Io
+{
+
public class LZ4VoxelTileCompressor {
@@ -38,3 +40,5 @@ public class LZ4VoxelTileCompressor {
}
}
+
+}
\ No newline at end of file
diff --git a/src/DotRecast.Detour.Dynamic/Io/VoxelFile.cs b/src/DotRecast.Detour.Dynamic/Io/VoxelFile.cs
index 2a7f8eb..9adec74 100644
--- a/src/DotRecast.Detour.Dynamic/Io/VoxelFile.cs
+++ b/src/DotRecast.Detour.Dynamic/Io/VoxelFile.cs
@@ -21,7 +21,9 @@ using System.Collections.Generic;
using DotRecast.Core;
using DotRecast.Recast;
-namespace DotRecast.Detour.Dynamic.Io;
+namespace DotRecast.Detour.Dynamic.Io
+{
+
public class VoxelFile {
@@ -54,7 +56,7 @@ public class VoxelFile {
public int tileSizeZ;
public float[] rotation = new float[3];
public float[] bounds = new float[6];
- public readonly List tiles = new();
+ public readonly List tiles = new List();
public void addTile(VoxelTile tile) {
tiles.Add(tile);
@@ -146,3 +148,5 @@ public class VoxelFile {
}
}
+
+}
\ No newline at end of file
diff --git a/src/DotRecast.Detour.Dynamic/Io/VoxelFileReader.cs b/src/DotRecast.Detour.Dynamic/Io/VoxelFileReader.cs
index 2d54b6a..e444d2c 100644
--- a/src/DotRecast.Detour.Dynamic/Io/VoxelFileReader.cs
+++ b/src/DotRecast.Detour.Dynamic/Io/VoxelFileReader.cs
@@ -20,7 +20,9 @@ using System.IO;
using DotRecast.Core;
using DotRecast.Detour.Io;
-namespace DotRecast.Detour.Dynamic.Io;
+namespace DotRecast.Detour.Dynamic.Io
+{
+
public class VoxelFileReader {
@@ -123,3 +125,5 @@ public class VoxelFileReader {
}
}
+
+}
\ No newline at end of file
diff --git a/src/DotRecast.Detour.Dynamic/Io/VoxelFileWriter.cs b/src/DotRecast.Detour.Dynamic/Io/VoxelFileWriter.cs
index 768e69d..d10f233 100644
--- a/src/DotRecast.Detour.Dynamic/Io/VoxelFileWriter.cs
+++ b/src/DotRecast.Detour.Dynamic/Io/VoxelFileWriter.cs
@@ -20,7 +20,9 @@ using System.IO;
using DotRecast.Core;
using DotRecast.Detour.Io;
-namespace DotRecast.Detour.Dynamic.Io;
+namespace DotRecast.Detour.Dynamic.Io
+{
+
public class VoxelFileWriter : DetourWriter {
@@ -87,3 +89,5 @@ public class VoxelFileWriter : DetourWriter {
}
}
+
+}
\ No newline at end of file
diff --git a/src/DotRecast.Detour.Dynamic/Io/VoxelTile.cs b/src/DotRecast.Detour.Dynamic/Io/VoxelTile.cs
index dd4d0c2..a902ae0 100644
--- a/src/DotRecast.Detour.Dynamic/Io/VoxelTile.cs
+++ b/src/DotRecast.Detour.Dynamic/Io/VoxelTile.cs
@@ -19,7 +19,9 @@ freely, subject to the following restrictions:
using DotRecast.Core;
using DotRecast.Recast;
-namespace DotRecast.Detour.Dynamic.Io;
+namespace DotRecast.Detour.Dynamic.Io
+{
+
public class VoxelTile {
@@ -179,3 +181,5 @@ public class VoxelTile {
return data;
}
}
+
+}
\ No newline at end of file
diff --git a/src/DotRecast.Detour.Dynamic/RemoveColliderQueueItem.cs b/src/DotRecast.Detour.Dynamic/RemoveColliderQueueItem.cs
index 2053936..999410e 100644
--- a/src/DotRecast.Detour.Dynamic/RemoveColliderQueueItem.cs
+++ b/src/DotRecast.Detour.Dynamic/RemoveColliderQueueItem.cs
@@ -18,7 +18,9 @@ freely, subject to the following restrictions:
using System.Collections.Generic;
-namespace DotRecast.Detour.Dynamic;
+namespace DotRecast.Detour.Dynamic
+{
+
public class RemoveColliderQueueItem : UpdateQueueItem {
@@ -39,3 +41,5 @@ public class RemoveColliderQueueItem : UpdateQueueItem {
}
}
+
+}
\ No newline at end of file
diff --git a/src/DotRecast.Detour.Dynamic/UpdateQueueItem.cs b/src/DotRecast.Detour.Dynamic/UpdateQueueItem.cs
index 0385d7e..acd0020 100644
--- a/src/DotRecast.Detour.Dynamic/UpdateQueueItem.cs
+++ b/src/DotRecast.Detour.Dynamic/UpdateQueueItem.cs
@@ -18,7 +18,9 @@ freely, subject to the following restrictions:
using System.Collections.Generic;
-namespace DotRecast.Detour.Dynamic;
+namespace DotRecast.Detour.Dynamic
+{
+
public interface UpdateQueueItem {
@@ -27,3 +29,5 @@ public interface UpdateQueueItem {
void process(DynamicTile tile);
}
+
+}
\ No newline at end of file
diff --git a/src/DotRecast.Detour.Dynamic/VoxelQuery.cs b/src/DotRecast.Detour.Dynamic/VoxelQuery.cs
index 6814f93..e8db3a5 100644
--- a/src/DotRecast.Detour.Dynamic/VoxelQuery.cs
+++ b/src/DotRecast.Detour.Dynamic/VoxelQuery.cs
@@ -19,7 +19,9 @@ freely, subject to the following restrictions:
using System;
using DotRecast.Recast;
-namespace DotRecast.Detour.Dynamic;
+namespace DotRecast.Detour.Dynamic
+{
+
/**
@@ -158,3 +160,5 @@ public class VoxelQuery {
}
}
+
+}
\ No newline at end of file
diff --git a/src/DotRecast.Detour.Extras/BVTreeBuilder.cs b/src/DotRecast.Detour.Extras/BVTreeBuilder.cs
index 3c28eb7..0a41d5d 100644
--- a/src/DotRecast.Detour.Extras/BVTreeBuilder.cs
+++ b/src/DotRecast.Detour.Extras/BVTreeBuilder.cs
@@ -18,7 +18,9 @@ freely, subject to the following restrictions:
using static DotRecast.Detour.DetourCommon;
-namespace DotRecast.Detour.Extras;
+namespace DotRecast.Detour.Extras
+{
+
public class BVTreeBuilder {
@@ -53,3 +55,5 @@ public class BVTreeBuilder {
}
}
+
+}
\ No newline at end of file
diff --git a/src/DotRecast.Detour.Extras/DotRecast.Detour.Extras.csproj b/src/DotRecast.Detour.Extras/DotRecast.Detour.Extras.csproj
index 1893aff..0a58b8c 100644
--- a/src/DotRecast.Detour.Extras/DotRecast.Detour.Extras.csproj
+++ b/src/DotRecast.Detour.Extras/DotRecast.Detour.Extras.csproj
@@ -1,8 +1,7 @@
- net7.0
-
+ netstandard2.1
diff --git a/src/DotRecast.Detour.Extras/Jumplink/AbstractGroundSampler.cs b/src/DotRecast.Detour.Extras/Jumplink/AbstractGroundSampler.cs
index 8f7b136..b209038 100644
--- a/src/DotRecast.Detour.Extras/Jumplink/AbstractGroundSampler.cs
+++ b/src/DotRecast.Detour.Extras/Jumplink/AbstractGroundSampler.cs
@@ -3,7 +3,9 @@ using System;
using DotRecast.Recast;
using static DotRecast.Detour.DetourCommon;
-namespace DotRecast.Detour.Extras.Jumplink;
+namespace DotRecast.Detour.Extras.Jumplink
+{
+
public abstract class AbstractGroundSampler : GroundSampler {
@@ -46,3 +48,5 @@ public abstract class AbstractGroundSampler : GroundSampler {
}
}
+
+}
\ No newline at end of file
diff --git a/src/DotRecast.Detour.Extras/Jumplink/ClimbTrajectory.cs b/src/DotRecast.Detour.Extras/Jumplink/ClimbTrajectory.cs
index 1ea074e..1b993a7 100644
--- a/src/DotRecast.Detour.Extras/Jumplink/ClimbTrajectory.cs
+++ b/src/DotRecast.Detour.Extras/Jumplink/ClimbTrajectory.cs
@@ -1,6 +1,8 @@
using System;
-namespace DotRecast.Detour.Extras.Jumplink;
+namespace DotRecast.Detour.Extras.Jumplink
+{
+
public class ClimbTrajectory : Trajectory {
@@ -11,3 +13,5 @@ public class ClimbTrajectory : Trajectory {
}
}
+
+}
\ No newline at end of file
diff --git a/src/DotRecast.Detour.Extras/Jumplink/Edge.cs b/src/DotRecast.Detour.Extras/Jumplink/Edge.cs
index 31c4eaa..58d1933 100644
--- a/src/DotRecast.Detour.Extras/Jumplink/Edge.cs
+++ b/src/DotRecast.Detour.Extras/Jumplink/Edge.cs
@@ -1,6 +1,10 @@
-namespace DotRecast.Detour.Extras.Jumplink;
+namespace DotRecast.Detour.Extras.Jumplink
+{
+
public class Edge {
public readonly float[] sp = new float[3];
public readonly float[] sq = new float[3];
}
+
+}
\ No newline at end of file
diff --git a/src/DotRecast.Detour.Extras/Jumplink/EdgeExtractor.cs b/src/DotRecast.Detour.Extras/Jumplink/EdgeExtractor.cs
index 6f4395e..0827f5a 100644
--- a/src/DotRecast.Detour.Extras/Jumplink/EdgeExtractor.cs
+++ b/src/DotRecast.Detour.Extras/Jumplink/EdgeExtractor.cs
@@ -3,11 +3,13 @@ using DotRecast.Recast;
using static DotRecast.Recast.RecastConstants;
-namespace DotRecast.Detour.Extras.Jumplink;
+namespace DotRecast.Detour.Extras.Jumplink
+{
+
public class EdgeExtractor {
public Edge[] extractEdges(PolyMesh mesh) {
- List edges = new();
+ List edges = new List();
if (mesh != null) {
float[] orig = mesh.bmin;
float cs = mesh.cs;
@@ -56,3 +58,5 @@ public class EdgeExtractor {
}
}
+
+}
\ No newline at end of file
diff --git a/src/DotRecast.Detour.Extras/Jumplink/EdgeSampler.cs b/src/DotRecast.Detour.Extras/Jumplink/EdgeSampler.cs
index 167c946..eaf9259 100644
--- a/src/DotRecast.Detour.Extras/Jumplink/EdgeSampler.cs
+++ b/src/DotRecast.Detour.Extras/Jumplink/EdgeSampler.cs
@@ -2,11 +2,13 @@
using System.Collections.Generic;
using static DotRecast.Detour.DetourCommon;
-namespace DotRecast.Detour.Extras.Jumplink;
+namespace DotRecast.Detour.Extras.Jumplink
+{
+
public class EdgeSampler {
public readonly GroundSegment start = new GroundSegment();
- public readonly List end = new();
+ public readonly List end = new List();
public readonly Trajectory trajectory;
public readonly float[] ax = new float[3];
@@ -23,3 +25,5 @@ public class EdgeSampler {
}
}
+
+}
\ No newline at end of file
diff --git a/src/DotRecast.Detour.Extras/Jumplink/EdgeSamplerFactory.cs b/src/DotRecast.Detour.Extras/Jumplink/EdgeSamplerFactory.cs
index 60385a2..8db5176 100644
--- a/src/DotRecast.Detour.Extras/Jumplink/EdgeSamplerFactory.cs
+++ b/src/DotRecast.Detour.Extras/Jumplink/EdgeSamplerFactory.cs
@@ -1,6 +1,8 @@
using System;
-namespace DotRecast.Detour.Extras.Jumplink;
+namespace DotRecast.Detour.Extras.Jumplink
+{
+
class EdgeSamplerFactory {
@@ -77,3 +79,5 @@ class EdgeSamplerFactory {
}
}
+
+}
\ No newline at end of file
diff --git a/src/DotRecast.Detour.Extras/Jumplink/GroundSample.cs b/src/DotRecast.Detour.Extras/Jumplink/GroundSample.cs
index d8a1244..95c09c8 100644
--- a/src/DotRecast.Detour.Extras/Jumplink/GroundSample.cs
+++ b/src/DotRecast.Detour.Extras/Jumplink/GroundSample.cs
@@ -1,7 +1,11 @@
-namespace DotRecast.Detour.Extras.Jumplink;
+namespace DotRecast.Detour.Extras.Jumplink
+{
+
public class GroundSample {
public readonly float[] p = new float[3];
public bool validTrajectory;
public bool validHeight;
}
+
+}
\ No newline at end of file
diff --git a/src/DotRecast.Detour.Extras/Jumplink/GroundSampler.cs b/src/DotRecast.Detour.Extras/Jumplink/GroundSampler.cs
index 55f495b..fc5a6e3 100644
--- a/src/DotRecast.Detour.Extras/Jumplink/GroundSampler.cs
+++ b/src/DotRecast.Detour.Extras/Jumplink/GroundSampler.cs
@@ -1,9 +1,13 @@
using DotRecast.Recast;
-namespace DotRecast.Detour.Extras.Jumplink;
+namespace DotRecast.Detour.Extras.Jumplink
+{
+
public interface GroundSampler {
void sample(JumpLinkBuilderConfig acfg, RecastBuilderResult result, EdgeSampler es);
}
+
+}
\ No newline at end of file
diff --git a/src/DotRecast.Detour.Extras/Jumplink/GroundSegment.cs b/src/DotRecast.Detour.Extras/Jumplink/GroundSegment.cs
index 19ef50e..7b64000 100644
--- a/src/DotRecast.Detour.Extras/Jumplink/GroundSegment.cs
+++ b/src/DotRecast.Detour.Extras/Jumplink/GroundSegment.cs
@@ -1,4 +1,6 @@
-namespace DotRecast.Detour.Extras.Jumplink;
+namespace DotRecast.Detour.Extras.Jumplink
+{
+
public class GroundSegment {
public readonly float[] p = new float[3];
@@ -7,3 +9,5 @@ public class GroundSegment {
public float height;
}
+
+}
\ No newline at end of file
diff --git a/src/DotRecast.Detour.Extras/Jumplink/JumpLink.cs b/src/DotRecast.Detour.Extras/Jumplink/JumpLink.cs
index b988844..0eb7f1f 100644
--- a/src/DotRecast.Detour.Extras/Jumplink/JumpLink.cs
+++ b/src/DotRecast.Detour.Extras/Jumplink/JumpLink.cs
@@ -1,4 +1,6 @@
-namespace DotRecast.Detour.Extras.Jumplink;
+namespace DotRecast.Detour.Extras.Jumplink
+{
+
public class JumpLink {
@@ -13,3 +15,5 @@ public class JumpLink {
public Trajectory trajectory;
}
+
+}
\ No newline at end of file
diff --git a/src/DotRecast.Detour.Extras/Jumplink/JumpLinkBuilder.cs b/src/DotRecast.Detour.Extras/Jumplink/JumpLinkBuilder.cs
index a0f43c8..4c842ee 100644
--- a/src/DotRecast.Detour.Extras/Jumplink/JumpLinkBuilder.cs
+++ b/src/DotRecast.Detour.Extras/Jumplink/JumpLinkBuilder.cs
@@ -5,7 +5,9 @@ using DotRecast.Core;
using DotRecast.Recast;
using static DotRecast.Detour.DetourCommon;
-namespace DotRecast.Detour.Extras.Jumplink;
+namespace DotRecast.Detour.Extras.Jumplink
+{
+
public class JumpLinkBuilder {
@@ -24,7 +26,7 @@ public class JumpLinkBuilder {
}
public List build(JumpLinkBuilderConfig acfg, JumpLinkType type) {
- List links = new();
+ List links = new List();
for (int tile = 0; tile < results.Count; tile++) {
Edge[] edges = this.edges[tile];
foreach (Edge edge in edges) {
@@ -44,7 +46,7 @@ public class JumpLinkBuilder {
private List buildJumpLinks(JumpLinkBuilderConfig acfg, EdgeSampler es, JumpSegment[] jumpSegments) {
- List links = new();
+ List links = new List();
foreach (JumpSegment js in jumpSegments) {
float[] sp = es.start.gsamples[js.startSample].p;
float[] sq = es.start.gsamples[js.startSample + js.samples - 1].p;
@@ -82,3 +84,5 @@ public class JumpLinkBuilder {
}
}
+
+}
\ No newline at end of file
diff --git a/src/DotRecast.Detour.Extras/Jumplink/JumpLinkBuilderConfig.cs b/src/DotRecast.Detour.Extras/Jumplink/JumpLinkBuilderConfig.cs
index 8404d4a..28eb1b2 100644
--- a/src/DotRecast.Detour.Extras/Jumplink/JumpLinkBuilderConfig.cs
+++ b/src/DotRecast.Detour.Extras/Jumplink/JumpLinkBuilderConfig.cs
@@ -1,4 +1,6 @@
-namespace DotRecast.Detour.Extras.Jumplink;
+namespace DotRecast.Detour.Extras.Jumplink
+{
+
public class JumpLinkBuilderConfig {
@@ -31,3 +33,5 @@ public class JumpLinkBuilderConfig {
}
}
+
+}
\ No newline at end of file
diff --git a/src/DotRecast.Detour.Extras/Jumplink/JumpLinkType.cs b/src/DotRecast.Detour.Extras/Jumplink/JumpLinkType.cs
index 22af40a..23ecbb8 100644
--- a/src/DotRecast.Detour.Extras/Jumplink/JumpLinkType.cs
+++ b/src/DotRecast.Detour.Extras/Jumplink/JumpLinkType.cs
@@ -1,5 +1,8 @@
-namespace DotRecast.Detour.Extras.Jumplink;
+namespace DotRecast.Detour.Extras.Jumplink
+{
+
public enum JumpLinkType {
EDGE_JUMP, EDGE_CLIMB_DOWN, EDGE_JUMP_OVER
+}
}
\ No newline at end of file
diff --git a/src/DotRecast.Detour.Extras/Jumplink/JumpSegment.cs b/src/DotRecast.Detour.Extras/Jumplink/JumpSegment.cs
index c9f29b2..f76588f 100644
--- a/src/DotRecast.Detour.Extras/Jumplink/JumpSegment.cs
+++ b/src/DotRecast.Detour.Extras/Jumplink/JumpSegment.cs
@@ -1,7 +1,11 @@
-namespace DotRecast.Detour.Extras.Jumplink;
+namespace DotRecast.Detour.Extras.Jumplink
+{
+
public class JumpSegment {
public int groundSegment;
public int startSample;
public int samples;
}
+
+}
\ No newline at end of file
diff --git a/src/DotRecast.Detour.Extras/Jumplink/JumpSegmentBuilder.cs b/src/DotRecast.Detour.Extras/Jumplink/JumpSegmentBuilder.cs
index 13674d1..6cbece4 100644
--- a/src/DotRecast.Detour.Extras/Jumplink/JumpSegmentBuilder.cs
+++ b/src/DotRecast.Detour.Extras/Jumplink/JumpSegmentBuilder.cs
@@ -3,7 +3,9 @@ using System.Collections.Generic;
using DotRecast.Core;
-namespace DotRecast.Detour.Extras.Jumplink;
+namespace DotRecast.Detour.Extras.Jumplink
+{
+
class JumpSegmentBuilder {
@@ -93,3 +95,5 @@ class JumpSegmentBuilder {
}
}
+
+}
\ No newline at end of file
diff --git a/src/DotRecast.Detour.Extras/Jumplink/JumpTrajectory.cs b/src/DotRecast.Detour.Extras/Jumplink/JumpTrajectory.cs
index 2275747..e7756e2 100644
--- a/src/DotRecast.Detour.Extras/Jumplink/JumpTrajectory.cs
+++ b/src/DotRecast.Detour.Extras/Jumplink/JumpTrajectory.cs
@@ -1,6 +1,8 @@
using System;
-namespace DotRecast.Detour.Extras.Jumplink;
+namespace DotRecast.Detour.Extras.Jumplink
+{
+
public class JumpTrajectory : Trajectory {
@@ -39,3 +41,5 @@ public class JumpTrajectory : Trajectory {
}
}
+
+}
\ No newline at end of file
diff --git a/src/DotRecast.Detour.Extras/Jumplink/NavMeshGroundSampler.cs b/src/DotRecast.Detour.Extras/Jumplink/NavMeshGroundSampler.cs
index 80437f2..65a4318 100644
--- a/src/DotRecast.Detour.Extras/Jumplink/NavMeshGroundSampler.cs
+++ b/src/DotRecast.Detour.Extras/Jumplink/NavMeshGroundSampler.cs
@@ -2,7 +2,9 @@ using System;
using DotRecast.Core;
using DotRecast.Recast;
-namespace DotRecast.Detour.Extras.Jumplink;
+namespace DotRecast.Detour.Extras.Jumplink
+{
+
class NavMeshGroundSampler : AbstractGroundSampler {
@@ -89,3 +91,5 @@ class NavMeshGroundSampler : AbstractGroundSampler {
}
}
+
+}
\ No newline at end of file
diff --git a/src/DotRecast.Detour.Extras/Jumplink/Trajectory.cs b/src/DotRecast.Detour.Extras/Jumplink/Trajectory.cs
index 9bfb787..49b2885 100644
--- a/src/DotRecast.Detour.Extras/Jumplink/Trajectory.cs
+++ b/src/DotRecast.Detour.Extras/Jumplink/Trajectory.cs
@@ -1,6 +1,8 @@
using System;
-namespace DotRecast.Detour.Extras.Jumplink;
+namespace DotRecast.Detour.Extras.Jumplink
+{
+
public class Trajectory {
@@ -14,3 +16,5 @@ public class Trajectory {
}
}
+
+}
\ No newline at end of file
diff --git a/src/DotRecast.Detour.Extras/Jumplink/TrajectorySampler.cs b/src/DotRecast.Detour.Extras/Jumplink/TrajectorySampler.cs
index 7aacce5..a0f2928 100644
--- a/src/DotRecast.Detour.Extras/Jumplink/TrajectorySampler.cs
+++ b/src/DotRecast.Detour.Extras/Jumplink/TrajectorySampler.cs
@@ -2,7 +2,9 @@ using System;
using DotRecast.Recast;
using static DotRecast.Detour.DetourCommon;
-namespace DotRecast.Detour.Extras.Jumplink;
+namespace DotRecast.Detour.Extras.Jumplink
+{
+
class TrajectorySampler {
@@ -74,3 +76,5 @@ class TrajectorySampler {
}
}
+
+}
\ No newline at end of file
diff --git a/src/DotRecast.Detour.Extras/ObjExporter.cs b/src/DotRecast.Detour.Extras/ObjExporter.cs
index 0dadcd7..bd04776 100644
--- a/src/DotRecast.Detour.Extras/ObjExporter.cs
+++ b/src/DotRecast.Detour.Extras/ObjExporter.cs
@@ -18,7 +18,9 @@ freely, subject to the following restrictions:
using System.IO;
-namespace DotRecast.Detour.Extras;
+namespace DotRecast.Detour.Extras
+{
+
public class ObjExporter {
@@ -62,3 +64,5 @@ public class ObjExporter {
*/
}
+
+}
\ No newline at end of file
diff --git a/src/DotRecast.Detour.Extras/PolyUtils.cs b/src/DotRecast.Detour.Extras/PolyUtils.cs
index a0928f7..c469fdb 100644
--- a/src/DotRecast.Detour.Extras/PolyUtils.cs
+++ b/src/DotRecast.Detour.Extras/PolyUtils.cs
@@ -15,7 +15,9 @@ freely, subject to the following restrictions:
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
-namespace DotRecast.Detour.Extras;
+namespace DotRecast.Detour.Extras
+{
+
public class PolyUtils {
@@ -78,3 +80,5 @@ public class PolyUtils {
return edge;
}
}
+
+}
\ No newline at end of file
diff --git a/src/DotRecast.Detour.Extras/Unity/Astar/BVTreeCreator.cs b/src/DotRecast.Detour.Extras/Unity/Astar/BVTreeCreator.cs
index 0ee68eb..2685c4c 100644
--- a/src/DotRecast.Detour.Extras/Unity/Astar/BVTreeCreator.cs
+++ b/src/DotRecast.Detour.Extras/Unity/Astar/BVTreeCreator.cs
@@ -15,7 +15,9 @@ freely, subject to the following restrictions:
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
-namespace DotRecast.Detour.Extras.Unity.Astar;
+namespace DotRecast.Detour.Extras.Unity.Astar
+{
+
public class BVTreeCreator {
@@ -28,3 +30,5 @@ public class BVTreeCreator {
}
}
+
+}
\ No newline at end of file
diff --git a/src/DotRecast.Detour.Extras/Unity/Astar/GraphConnectionReader.cs b/src/DotRecast.Detour.Extras/Unity/Astar/GraphConnectionReader.cs
index 593a18e..a06ac5d 100644
--- a/src/DotRecast.Detour.Extras/Unity/Astar/GraphConnectionReader.cs
+++ b/src/DotRecast.Detour.Extras/Unity/Astar/GraphConnectionReader.cs
@@ -20,12 +20,14 @@ using System.Collections.Generic;
using System.IO.Compression;
using DotRecast.Core;
-namespace DotRecast.Detour.Extras.Unity.Astar;
+namespace DotRecast.Detour.Extras.Unity.Astar
+{
+
class GraphConnectionReader : ZipBinaryReader {
public List read(ZipArchive file, string filename, Meta meta, int[] indexToNode) {
- List connections = new();
+ List connections = new List();
ByteBuffer buffer = toByteBuffer(file, filename);
while (buffer.remaining() > 0) {
int count = buffer.getInt();
@@ -45,3 +47,5 @@ class GraphConnectionReader : ZipBinaryReader {
}
}
+
+}
\ No newline at end of file
diff --git a/src/DotRecast.Detour.Extras/Unity/Astar/GraphData.cs b/src/DotRecast.Detour.Extras/Unity/Astar/GraphData.cs
index 6ee941b..320ccbc 100644
--- a/src/DotRecast.Detour.Extras/Unity/Astar/GraphData.cs
+++ b/src/DotRecast.Detour.Extras/Unity/Astar/GraphData.cs
@@ -18,7 +18,9 @@ freely, subject to the following restrictions:
using System.Collections.Generic;
-namespace DotRecast.Detour.Extras.Unity.Astar;
+namespace DotRecast.Detour.Extras.Unity.Astar
+{
+
@@ -42,3 +44,5 @@ public class GraphData {
}
}
+
+}
\ No newline at end of file
diff --git a/src/DotRecast.Detour.Extras/Unity/Astar/GraphMeshData.cs b/src/DotRecast.Detour.Extras/Unity/Astar/GraphMeshData.cs
index 70bfbb3..81a648b 100644
--- a/src/DotRecast.Detour.Extras/Unity/Astar/GraphMeshData.cs
+++ b/src/DotRecast.Detour.Extras/Unity/Astar/GraphMeshData.cs
@@ -15,7 +15,9 @@ freely, subject to the following restrictions:
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
-namespace DotRecast.Detour.Extras.Unity.Astar;
+namespace DotRecast.Detour.Extras.Unity.Astar
+{
+
public class GraphMeshData {
@@ -60,3 +62,5 @@ public class GraphMeshData {
}
}
+
+}
\ No newline at end of file
diff --git a/src/DotRecast.Detour.Extras/Unity/Astar/GraphMeshDataReader.cs b/src/DotRecast.Detour.Extras/Unity/Astar/GraphMeshDataReader.cs
index dd5ec1b..0196567 100644
--- a/src/DotRecast.Detour.Extras/Unity/Astar/GraphMeshDataReader.cs
+++ b/src/DotRecast.Detour.Extras/Unity/Astar/GraphMeshDataReader.cs
@@ -21,7 +21,9 @@ using System.IO.Compression;
using System.Numerics;
using DotRecast.Core;
-namespace DotRecast.Detour.Extras.Unity.Astar;
+namespace DotRecast.Detour.Extras.Unity.Astar
+{
+
public class GraphMeshDataReader : ZipBinaryReader {
@@ -137,10 +139,20 @@ public class GraphMeshDataReader : ZipBinaryReader {
return new GraphMeshData(tileXCount, tileZCount, tiles);
}
+ public static int highestOneBit(uint i)
+ {
+ i |= (i >> 1);
+ i |= (i >> 2);
+ i |= (i >> 4);
+ i |= (i >> 8);
+ i |= (i >> 16);
+ return (int)(i - (i >> 1));
+ }
+
// See NavmeshBase.cs: ASTAR_RECAST_LARGER_TILES
private int getVertMask(int vertsCount)
{
- int vertMask = 1 << (BitOperations.Log2((uint)vertsCount) + 1);
+ int vertMask = 1 << highestOneBit((uint)vertsCount);
if (vertMask != vertsCount) {
vertMask *= 2;
}
@@ -149,3 +161,5 @@ public class GraphMeshDataReader : ZipBinaryReader {
}
}
+
+}
\ No newline at end of file
diff --git a/src/DotRecast.Detour.Extras/Unity/Astar/GraphMeta.cs b/src/DotRecast.Detour.Extras/Unity/Astar/GraphMeta.cs
index b146493..d313106 100644
--- a/src/DotRecast.Detour.Extras/Unity/Astar/GraphMeta.cs
+++ b/src/DotRecast.Detour.Extras/Unity/Astar/GraphMeta.cs
@@ -15,7 +15,9 @@ freely, subject to the following restrictions:
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
-namespace DotRecast.Detour.Extras.Unity.Astar;
+namespace DotRecast.Detour.Extras.Unity.Astar
+{
+
@@ -37,3 +39,5 @@ public class GraphMeta {
public Vector3f forcedBoundsCenter { get; set; }
public Vector3f forcedBoundsSize { get; set; }
}
+
+}
\ No newline at end of file
diff --git a/src/DotRecast.Detour.Extras/Unity/Astar/GraphMetaReader.cs b/src/DotRecast.Detour.Extras/Unity/Astar/GraphMetaReader.cs
index ced0868..6c180e4 100644
--- a/src/DotRecast.Detour.Extras/Unity/Astar/GraphMetaReader.cs
+++ b/src/DotRecast.Detour.Extras/Unity/Astar/GraphMetaReader.cs
@@ -20,7 +20,9 @@ using System.IO;
using System.IO.Compression;
using System.Text.Json;
-namespace DotRecast.Detour.Extras.Unity.Astar;
+namespace DotRecast.Detour.Extras.Unity.Astar
+{
+
public class GraphMetaReader {
@@ -36,3 +38,5 @@ public class GraphMetaReader {
return JsonSerializer.Deserialize(json, options);
}
}
+
+}
\ No newline at end of file
diff --git a/src/DotRecast.Detour.Extras/Unity/Astar/LinkBuilder.cs b/src/DotRecast.Detour.Extras/Unity/Astar/LinkBuilder.cs
index 3cf4629..92c9bc3 100644
--- a/src/DotRecast.Detour.Extras/Unity/Astar/LinkBuilder.cs
+++ b/src/DotRecast.Detour.Extras/Unity/Astar/LinkBuilder.cs
@@ -19,7 +19,9 @@ freely, subject to the following restrictions:
using System;
using System.Collections.Generic;
-namespace DotRecast.Detour.Extras.Unity.Astar;
+namespace DotRecast.Detour.Extras.Unity.Astar
+{
+
public class LinkBuilder {
@@ -64,3 +66,5 @@ public class LinkBuilder {
}
}
+
+}
\ No newline at end of file
diff --git a/src/DotRecast.Detour.Extras/Unity/Astar/Meta.cs b/src/DotRecast.Detour.Extras/Unity/Astar/Meta.cs
index d02fcbc..7bb0b70 100644
--- a/src/DotRecast.Detour.Extras/Unity/Astar/Meta.cs
+++ b/src/DotRecast.Detour.Extras/Unity/Astar/Meta.cs
@@ -19,7 +19,9 @@ freely, subject to the following restrictions:
using System;
using System.Text.RegularExpressions;
-namespace DotRecast.Detour.Extras.Unity.Astar;
+namespace DotRecast.Detour.Extras.Unity.Astar
+{
+
public class Meta {
@@ -71,3 +73,5 @@ public class Meta {
}
}
+
+}
\ No newline at end of file
diff --git a/src/DotRecast.Detour.Extras/Unity/Astar/MetaReader.cs b/src/DotRecast.Detour.Extras/Unity/Astar/MetaReader.cs
index 0f32ce1..bd94b0b 100644
--- a/src/DotRecast.Detour.Extras/Unity/Astar/MetaReader.cs
+++ b/src/DotRecast.Detour.Extras/Unity/Astar/MetaReader.cs
@@ -23,7 +23,9 @@ using System.Text.Json;
using System.Text.Json.Nodes;
using System.Text.RegularExpressions;
-namespace DotRecast.Detour.Extras.Unity.Astar;
+namespace DotRecast.Detour.Extras.Unity.Astar
+{
+
public class MetaReader {
@@ -52,3 +54,5 @@ public class MetaReader {
}
}
+
+}
\ No newline at end of file
diff --git a/src/DotRecast.Detour.Extras/Unity/Astar/NodeIndexReader.cs b/src/DotRecast.Detour.Extras/Unity/Astar/NodeIndexReader.cs
index 2bddae8..acb9e55 100644
--- a/src/DotRecast.Detour.Extras/Unity/Astar/NodeIndexReader.cs
+++ b/src/DotRecast.Detour.Extras/Unity/Astar/NodeIndexReader.cs
@@ -19,7 +19,9 @@ freely, subject to the following restrictions:
using System.IO.Compression;
using DotRecast.Core;
-namespace DotRecast.Detour.Extras.Unity.Astar;
+namespace DotRecast.Detour.Extras.Unity.Astar
+{
+
class NodeIndexReader : ZipBinaryReader {
@@ -36,3 +38,5 @@ class NodeIndexReader : ZipBinaryReader {
}
}
+
+}
\ No newline at end of file
diff --git a/src/DotRecast.Detour.Extras/Unity/Astar/NodeLink2.cs b/src/DotRecast.Detour.Extras/Unity/Astar/NodeLink2.cs
index 3db34b0..c5e2b8d 100644
--- a/src/DotRecast.Detour.Extras/Unity/Astar/NodeLink2.cs
+++ b/src/DotRecast.Detour.Extras/Unity/Astar/NodeLink2.cs
@@ -15,7 +15,9 @@ freely, subject to the following restrictions:
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
-namespace DotRecast.Detour.Extras.Unity.Astar;
+namespace DotRecast.Detour.Extras.Unity.Astar
+{
+
public class NodeLink2 {
public readonly long linkID;
@@ -33,3 +35,5 @@ public class NodeLink2 {
}
}
+
+}
\ No newline at end of file
diff --git a/src/DotRecast.Detour.Extras/Unity/Astar/NodeLink2Reader.cs b/src/DotRecast.Detour.Extras/Unity/Astar/NodeLink2Reader.cs
index 8e15e84..50fc6fe 100644
--- a/src/DotRecast.Detour.Extras/Unity/Astar/NodeLink2Reader.cs
+++ b/src/DotRecast.Detour.Extras/Unity/Astar/NodeLink2Reader.cs
@@ -19,7 +19,9 @@ freely, subject to the following restrictions:
using System.IO.Compression;
using DotRecast.Core;
-namespace DotRecast.Detour.Extras.Unity.Astar;
+namespace DotRecast.Detour.Extras.Unity.Astar
+{
+
public class NodeLink2Reader : ZipBinaryReader {
@@ -47,3 +49,5 @@ public class NodeLink2Reader : ZipBinaryReader {
return links;
}
}
+
+}
\ No newline at end of file
diff --git a/src/DotRecast.Detour.Extras/Unity/Astar/OffMeshLinkCreator.cs b/src/DotRecast.Detour.Extras/Unity/Astar/OffMeshLinkCreator.cs
index e1e1460..d7fbd07 100644
--- a/src/DotRecast.Detour.Extras/Unity/Astar/OffMeshLinkCreator.cs
+++ b/src/DotRecast.Detour.Extras/Unity/Astar/OffMeshLinkCreator.cs
@@ -18,7 +18,9 @@ freely, subject to the following restrictions:
using DotRecast.Core;
-namespace DotRecast.Detour.Extras.Unity.Astar;
+namespace DotRecast.Detour.Extras.Unity.Astar
+{
+
public class OffMeshLinkCreator {
@@ -61,3 +63,5 @@ public class OffMeshLinkCreator {
}
}
}
+
+}
\ No newline at end of file
diff --git a/src/DotRecast.Detour.Extras/Unity/Astar/UnityAStarPathfindingImporter.cs b/src/DotRecast.Detour.Extras/Unity/Astar/UnityAStarPathfindingImporter.cs
index d1889b2..c6e36e6 100644
--- a/src/DotRecast.Detour.Extras/Unity/Astar/UnityAStarPathfindingImporter.cs
+++ b/src/DotRecast.Detour.Extras/Unity/Astar/UnityAStarPathfindingImporter.cs
@@ -20,7 +20,9 @@ using System;
using System.Collections.Generic;
using System.IO;
-namespace DotRecast.Detour.Extras.Unity.Astar;
+namespace DotRecast.Detour.Extras.Unity.Astar
+{
+
/**
* Import navmeshes created with A* Pathfinding Project Unity plugin (https://arongranberg.com/astar/). Graph data is
@@ -73,3 +75,5 @@ public class UnityAStarPathfindingImporter {
}
}
+
+}
\ No newline at end of file
diff --git a/src/DotRecast.Detour.Extras/Unity/Astar/UnityAStarPathfindingReader.cs b/src/DotRecast.Detour.Extras/Unity/Astar/UnityAStarPathfindingReader.cs
index 45e59d9..b0e17c1 100644
--- a/src/DotRecast.Detour.Extras/Unity/Astar/UnityAStarPathfindingReader.cs
+++ b/src/DotRecast.Detour.Extras/Unity/Astar/UnityAStarPathfindingReader.cs
@@ -20,7 +20,9 @@ using System.Collections.Generic;
using System.IO;
using System.IO.Compression;
-namespace DotRecast.Detour.Extras.Unity.Astar;
+namespace DotRecast.Detour.Extras.Unity.Astar
+{
+
public class UnityAStarPathfindingReader {
@@ -47,9 +49,9 @@ public class UnityAStarPathfindingReader {
// Read NodeLink2 data (off-mesh links)
NodeLink2[] nodeLinks2 = nodeLink2Reader.read(file, NODE_LINK_2_FILE_NAME, indexToNode);
// Read graph by graph
- List metaList = new();
- List meshDataList = new();
- List> connectionsList = new();
+ List metaList = new List();
+ List meshDataList = new List();
+ List> connectionsList = new List>();
for (int graphIndex = 0; graphIndex < meta.graphs; graphIndex++) {
GraphMeta graphMeta = graphMetaReader.read(file, string.Format(GRAPH_META_FILE_NAME_PATTERN, graphIndex));
// First graph mesh data - vertices and polygons
@@ -65,3 +67,5 @@ public class UnityAStarPathfindingReader {
return new GraphData(meta, indexToNode, nodeLinks2, metaList, meshDataList, connectionsList);
}
}
+
+}
\ No newline at end of file
diff --git a/src/DotRecast.Detour.Extras/Unity/Astar/ZipBinaryReader.cs b/src/DotRecast.Detour.Extras/Unity/Astar/ZipBinaryReader.cs
index 067f747..ff526b0 100644
--- a/src/DotRecast.Detour.Extras/Unity/Astar/ZipBinaryReader.cs
+++ b/src/DotRecast.Detour.Extras/Unity/Astar/ZipBinaryReader.cs
@@ -21,7 +21,9 @@ using System.IO.Compression;
using DotRecast.Core;
using DotRecast.Detour.Io;
-namespace DotRecast.Detour.Extras.Unity.Astar;
+namespace DotRecast.Detour.Extras.Unity.Astar
+{
+
public abstract class ZipBinaryReader {
@@ -35,3 +37,5 @@ public abstract class ZipBinaryReader {
}
}
+
+}
\ No newline at end of file
diff --git a/src/DotRecast.Detour.Extras/Vector3f.cs b/src/DotRecast.Detour.Extras/Vector3f.cs
index b2d8299..c9c1411 100644
--- a/src/DotRecast.Detour.Extras/Vector3f.cs
+++ b/src/DotRecast.Detour.Extras/Vector3f.cs
@@ -15,7 +15,9 @@ freely, subject to the following restrictions:
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
-namespace DotRecast.Detour.Extras;
+namespace DotRecast.Detour.Extras
+{
+
public class Vector3f {
@@ -33,3 +35,5 @@ public class Vector3f {
}
}
+
+}
\ No newline at end of file
diff --git a/src/DotRecast.Detour.TileCache/AbstractTileLayersBuilder.cs b/src/DotRecast.Detour.TileCache/AbstractTileLayersBuilder.cs
index 5bdc01a..ca23531 100644
--- a/src/DotRecast.Detour.TileCache/AbstractTileLayersBuilder.cs
+++ b/src/DotRecast.Detour.TileCache/AbstractTileLayersBuilder.cs
@@ -25,7 +25,9 @@ using System.Linq;
using System.Threading.Tasks;
using DotRecast.Core;
-namespace DotRecast.Detour.TileCache;
+namespace DotRecast.Detour.TileCache
+{
+
public abstract class AbstractTileLayersBuilder {
@@ -37,7 +39,7 @@ public abstract class AbstractTileLayersBuilder {
}
private List buildSingleThread(ByteOrder order, bool cCompatibility, int tw, int th) {
- List layers = new();
+ List layers = new List();
for (int y = 0; y < th; ++y) {
for (int x = 0; x < tw; ++x) {
layers.AddRange(build(x, y, order, cCompatibility));
@@ -64,7 +66,7 @@ public abstract class AbstractTileLayersBuilder {
.Select(x => x.Result)
.ToDictionary(x => Tuple.Create(x.Item1, x.Item2), x => x.Item3);
- List layers = new();
+ List layers = new List();
for (int y = 0; y < th; ++y) {
for (int x = 0; x < tw; ++x) {
var key = Tuple.Create(x, y);
@@ -76,3 +78,5 @@ public abstract class AbstractTileLayersBuilder {
protected abstract List build(int tx, int ty, ByteOrder order, bool cCompatibility);
}
+
+}
\ No newline at end of file
diff --git a/src/DotRecast.Detour.TileCache/CompressedTile.cs b/src/DotRecast.Detour.TileCache/CompressedTile.cs
index 905ec7d..372d7e0 100644
--- a/src/DotRecast.Detour.TileCache/CompressedTile.cs
+++ b/src/DotRecast.Detour.TileCache/CompressedTile.cs
@@ -17,7 +17,9 @@ freely, subject to the following restrictions:
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
-namespace DotRecast.Detour.TileCache;
+namespace DotRecast.Detour.TileCache
+{
+
public class CompressedTile {
public readonly int index;
@@ -33,3 +35,5 @@ public class CompressedTile {
salt = 1;
}
}
+
+}
\ No newline at end of file
diff --git a/src/DotRecast.Detour.TileCache/DotRecast.Detour.TileCache.csproj b/src/DotRecast.Detour.TileCache/DotRecast.Detour.TileCache.csproj
index 009c40d..1ca182e 100644
--- a/src/DotRecast.Detour.TileCache/DotRecast.Detour.TileCache.csproj
+++ b/src/DotRecast.Detour.TileCache/DotRecast.Detour.TileCache.csproj
@@ -1,7 +1,7 @@
- net7.0
+ netstandard2.1
diff --git a/src/DotRecast.Detour.TileCache/Io/Compress/FastLz.cs b/src/DotRecast.Detour.TileCache/Io/Compress/FastLz.cs
index 5588f5c..ed02d48 100644
--- a/src/DotRecast.Detour.TileCache/Io/Compress/FastLz.cs
+++ b/src/DotRecast.Detour.TileCache/Io/Compress/FastLz.cs
@@ -16,7 +16,9 @@
using System;
-namespace DotRecast.Detour.TileCache.Io.Compress;
+namespace DotRecast.Detour.TileCache.Io.Compress
+{
+
/**
* Core of FastLZ compression algorithm.
@@ -311,10 +313,10 @@ public class FastLz {
if (level == LEVEL_2) {
if (distance < MAX_DISTANCE) {
if (len < 7) {
- output[outOffset + op++] = (byte) ((len << 5) + (distance >>> 8));
+ output[outOffset + op++] = (byte) ((len << 5) + (int)((ulong)distance >> 8));
output[outOffset + op++] = (byte) (distance & 255);
} else {
- output[outOffset + op++] = (byte) ((7 << 5) + (distance >>> 8));
+ output[outOffset + op++] = (byte) ((7 << 5) + ((ulong)distance >> 8));
for (len -= 7; len >= 255; len -= 255) {
output[outOffset + op++] = (byte) 255;
}
@@ -327,7 +329,7 @@ public class FastLz {
distance -= MAX_DISTANCE;
output[outOffset + op++] = (byte) ((len << 5) + 31);
output[outOffset + op++] = (byte) 255;
- output[outOffset + op++] = (byte) (distance >>> 8);
+ output[outOffset + op++] = (byte) ((ulong)distance >> 8);
output[outOffset + op++] = (byte) (distance & 255);
} else {
distance -= MAX_DISTANCE;
@@ -337,14 +339,14 @@ public class FastLz {
}
output[outOffset + op++] = (byte) len;
output[outOffset + op++] = (byte) 255;
- output[outOffset + op++] = (byte) (distance >>> 8);
+ output[outOffset + op++] = (byte) ((ulong)distance >> 8);
output[outOffset + op++] = (byte) (distance & 255);
}
}
} else {
if (len > MAX_LEN - 2) {
while (len > MAX_LEN - 2) {
- output[outOffset + op++] = (byte) ((7 << 5) + (distance >>> 8));
+ output[outOffset + op++] = (byte) ((7 << 5) + ((ulong)distance >> 8));
output[outOffset + op++] = (byte) (MAX_LEN - 2 - 7 - 2);
output[outOffset + op++] = (byte) (distance & 255);
len -= MAX_LEN - 2;
@@ -352,10 +354,10 @@ public class FastLz {
}
if (len < 7) {
- output[outOffset + op++] = (byte) ((len << 5) + (distance >>> 8));
+ output[outOffset + op++] = (byte) ((len << 5) + (int)((ulong)distance >> 8));
output[outOffset + op++] = (byte) (distance & 255);
} else {
- output[outOffset + op++] = (byte) ((7 << 5) + (distance >>> 8));
+ output[outOffset + op++] = (byte) ((7 << 5) + (int)((ulong)distance >> 8));
output[outOffset + op++] = (byte) (len - 7);
output[outOffset + op++] = (byte) (distance & 255);
}
@@ -573,4 +575,5 @@ public class FastLz {
}
private FastLz() { }
+}
}
\ 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 0c520b4..5250d00 100644
--- a/src/DotRecast.Detour.TileCache/Io/Compress/FastLzTileCacheCompressor.cs
+++ b/src/DotRecast.Detour.TileCache/Io/Compress/FastLzTileCacheCompressor.cs
@@ -21,7 +21,9 @@ freely, subject to the following restrictions:
using DotRecast.Core;
using K4os.Compression.LZ4;
-namespace DotRecast.Detour.TileCache.Io.Compress;
+namespace DotRecast.Detour.TileCache.Io.Compress
+{
+
public class FastLzTileCacheCompressor : TileCacheCompressor {
@@ -38,3 +40,5 @@ public class FastLzTileCacheCompressor : TileCacheCompressor {
}
}
+
+}
\ No newline at end of file
diff --git a/src/DotRecast.Detour.TileCache/Io/Compress/LZ4TileCacheCompressor.cs b/src/DotRecast.Detour.TileCache/Io/Compress/LZ4TileCacheCompressor.cs
index afca03a..40c1619 100644
--- a/src/DotRecast.Detour.TileCache/Io/Compress/LZ4TileCacheCompressor.cs
+++ b/src/DotRecast.Detour.TileCache/Io/Compress/LZ4TileCacheCompressor.cs
@@ -20,7 +20,9 @@ freely, subject to the following restrictions:
using K4os.Compression.LZ4;
-namespace DotRecast.Detour.TileCache.Io.Compress;
+namespace DotRecast.Detour.TileCache.Io.Compress
+{
+
public class LZ4TileCacheCompressor : TileCacheCompressor {
@@ -33,3 +35,5 @@ public class LZ4TileCacheCompressor : TileCacheCompressor {
}
}
+
+}
\ No newline at end of file
diff --git a/src/DotRecast.Detour.TileCache/Io/Compress/TileCacheCompressorFactory.cs b/src/DotRecast.Detour.TileCache/Io/Compress/TileCacheCompressorFactory.cs
index b411084..e1e8bef 100644
--- a/src/DotRecast.Detour.TileCache/Io/Compress/TileCacheCompressorFactory.cs
+++ b/src/DotRecast.Detour.TileCache/Io/Compress/TileCacheCompressorFactory.cs
@@ -17,13 +17,21 @@ freely, subject to the following restrictions:
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
-namespace DotRecast.Detour.TileCache.Io.Compress;
+namespace DotRecast.Detour.TileCache.Io.Compress
+{
+
public class TileCacheCompressorFactory {
- public static TileCacheCompressor get(bool cCompatibility) {
- return cCompatibility ? new FastLzTileCacheCompressor() : new LZ4TileCacheCompressor();
+ public static TileCacheCompressor get(bool cCompatibility)
+ {
+ if (cCompatibility)
+ return new FastLzTileCacheCompressor();
+
+ return new LZ4TileCacheCompressor();
}
}
+
+}
\ 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 c745637..68611e6 100644
--- a/src/DotRecast.Detour.TileCache/Io/TileCacheLayerHeaderReader.cs
+++ b/src/DotRecast.Detour.TileCache/Io/TileCacheLayerHeaderReader.cs
@@ -21,7 +21,9 @@ freely, subject to the following restrictions:
using System.IO;
using DotRecast.Core;
-namespace DotRecast.Detour.TileCache.Io;
+namespace DotRecast.Detour.TileCache.Io
+{
+
public class TileCacheLayerHeaderReader {
@@ -59,3 +61,5 @@ public class TileCacheLayerHeaderReader {
}
}
+
+}
\ No newline at end of file
diff --git a/src/DotRecast.Detour.TileCache/Io/TileCacheLayerHeaderWriter.cs b/src/DotRecast.Detour.TileCache/Io/TileCacheLayerHeaderWriter.cs
index 64fddd4..b9d7790 100644
--- a/src/DotRecast.Detour.TileCache/Io/TileCacheLayerHeaderWriter.cs
+++ b/src/DotRecast.Detour.TileCache/Io/TileCacheLayerHeaderWriter.cs
@@ -22,7 +22,9 @@ using System.IO;
using DotRecast.Core;
using DotRecast.Detour.Io;
-namespace DotRecast.Detour.TileCache.Io;
+namespace DotRecast.Detour.TileCache.Io
+{
+
public class TileCacheLayerHeaderWriter : DetourWriter {
@@ -52,3 +54,5 @@ public class TileCacheLayerHeaderWriter : DetourWriter {
}
}
+
+}
\ No newline at end of file
diff --git a/src/DotRecast.Detour.TileCache/Io/TileCacheReader.cs b/src/DotRecast.Detour.TileCache/Io/TileCacheReader.cs
index 166ba3b..a24820e 100644
--- a/src/DotRecast.Detour.TileCache/Io/TileCacheReader.cs
+++ b/src/DotRecast.Detour.TileCache/Io/TileCacheReader.cs
@@ -23,7 +23,9 @@ using DotRecast.Core;
using DotRecast.Detour.Io;
using DotRecast.Detour.TileCache.Io.Compress;
-namespace DotRecast.Detour.TileCache.Io;
+namespace DotRecast.Detour.TileCache.Io
+{
+
public class TileCacheReader {
@@ -93,3 +95,5 @@ public class TileCacheReader {
return option;
}
}
+
+}
\ No newline at end of file
diff --git a/src/DotRecast.Detour.TileCache/Io/TileCacheSetHeader.cs b/src/DotRecast.Detour.TileCache/Io/TileCacheSetHeader.cs
index 036e762..49f7a78 100644
--- a/src/DotRecast.Detour.TileCache/Io/TileCacheSetHeader.cs
+++ b/src/DotRecast.Detour.TileCache/Io/TileCacheSetHeader.cs
@@ -17,7 +17,9 @@ freely, subject to the following restrictions:
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
-namespace DotRecast.Detour.TileCache.Io;
+namespace DotRecast.Detour.TileCache.Io
+{
+
public class TileCacheSetHeader {
@@ -32,3 +34,5 @@ public class TileCacheSetHeader {
public TileCacheParams cacheParams = new TileCacheParams();
}
+
+}
\ No newline at end of file
diff --git a/src/DotRecast.Detour.TileCache/Io/TileCacheWriter.cs b/src/DotRecast.Detour.TileCache/Io/TileCacheWriter.cs
index bcae6b6..8b4ce51 100644
--- a/src/DotRecast.Detour.TileCache/Io/TileCacheWriter.cs
+++ b/src/DotRecast.Detour.TileCache/Io/TileCacheWriter.cs
@@ -22,7 +22,9 @@ using System.IO;
using DotRecast.Core;
using DotRecast.Detour.Io;
-namespace DotRecast.Detour.TileCache.Io;
+namespace DotRecast.Detour.TileCache.Io
+{
+
public class TileCacheWriter : DetourWriter {
@@ -73,3 +75,5 @@ public class TileCacheWriter : DetourWriter {
}
}
+
+}
\ No newline at end of file
diff --git a/src/DotRecast.Detour.TileCache/ObstacleRequest.cs b/src/DotRecast.Detour.TileCache/ObstacleRequest.cs
index 4162adc..773a28d 100644
--- a/src/DotRecast.Detour.TileCache/ObstacleRequest.cs
+++ b/src/DotRecast.Detour.TileCache/ObstacleRequest.cs
@@ -17,9 +17,13 @@ freely, subject to the following restrictions:
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
-namespace DotRecast.Detour.TileCache;
+namespace DotRecast.Detour.TileCache
+{
+
public class ObstacleRequest {
public ObstacleRequestAction action;
public long refs;
}
+
+}
\ No newline at end of file
diff --git a/src/DotRecast.Detour.TileCache/ObstacleRequestAction.cs b/src/DotRecast.Detour.TileCache/ObstacleRequestAction.cs
index ef7b850..875fad9 100644
--- a/src/DotRecast.Detour.TileCache/ObstacleRequestAction.cs
+++ b/src/DotRecast.Detour.TileCache/ObstacleRequestAction.cs
@@ -17,8 +17,12 @@ freely, subject to the following restrictions:
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
-namespace DotRecast.Detour.TileCache;
+namespace DotRecast.Detour.TileCache
+{
+
public enum ObstacleRequestAction {
REQUEST_ADD, REQUEST_REMOVE
}
+
+}
\ No newline at end of file
diff --git a/src/DotRecast.Detour.TileCache/ObstacleState.cs b/src/DotRecast.Detour.TileCache/ObstacleState.cs
index abc5fb3..95722b2 100644
--- a/src/DotRecast.Detour.TileCache/ObstacleState.cs
+++ b/src/DotRecast.Detour.TileCache/ObstacleState.cs
@@ -17,9 +17,13 @@ freely, subject to the following restrictions:
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
-namespace DotRecast.Detour.TileCache;
+namespace DotRecast.Detour.TileCache
+{
+
public enum ObstacleState {
DT_OBSTACLE_EMPTY, DT_OBSTACLE_PROCESSING, DT_OBSTACLE_PROCESSED, DT_OBSTACLE_REMOVING
}
+
+}
\ No newline at end of file
diff --git a/src/DotRecast.Detour.TileCache/TileCache.cs b/src/DotRecast.Detour.TileCache/TileCache.cs
index 9957083..5ba9184 100644
--- a/src/DotRecast.Detour.TileCache/TileCache.cs
+++ b/src/DotRecast.Detour.TileCache/TileCache.cs
@@ -25,7 +25,9 @@ using DotRecast.Detour.TileCache.Io;
using static DotRecast.Detour.DetourCommon;
-namespace DotRecast.Detour.TileCache;
+namespace DotRecast.Detour.TileCache
+{
+
public class TileCache {
@@ -46,11 +48,11 @@ public class TileCache {
private readonly TileCacheCompressor m_tcomp;
private readonly TileCacheMeshProcess m_tmproc;
- private readonly List m_obstacles = new();
+ private readonly List m_obstacles = new List();
private TileCacheObstacle m_nextFreeObstacle;
- private readonly List m_reqs = new();
- private readonly List m_update = new();
+ private readonly List m_reqs = new List();
+ private readonly List m_update = new List();
private readonly TileCacheBuilder builder = new TileCacheBuilder();
private readonly TileCacheLayerHeaderReader tileReader = new TileCacheLayerHeaderReader();
@@ -137,7 +139,7 @@ public class TileCache {
}
public List getTilesAt(int tx, int ty) {
- List tiles = new();
+ List tiles = new List();
// Find tile based on hash.
int h = NavMesh.computeTileHash(tx, ty, m_tileLutMask);
@@ -357,7 +359,7 @@ public class TileCache {
}
List queryTiles(float[] bmin, float[] bmax) {
- List results = new();
+ List results = new List();
float tw = m_params.width * m_params.cs;
float th = m_params.height * m_params.cs;
int tx0 = (int) Math.Floor((bmin[0] - m_params.orig[0]) / tw);
@@ -603,3 +605,5 @@ public class TileCache {
return m_navmesh;
}
}
+
+}
\ No newline at end of file
diff --git a/src/DotRecast.Detour.TileCache/TileCacheBuilder.cs b/src/DotRecast.Detour.TileCache/TileCacheBuilder.cs
index 294ddba..fae9cc8 100644
--- a/src/DotRecast.Detour.TileCache/TileCacheBuilder.cs
+++ b/src/DotRecast.Detour.TileCache/TileCacheBuilder.cs
@@ -26,7 +26,9 @@ using DotRecast.Detour.TileCache.Io;
using DotRecast.Detour.TileCache.Io.Compress;
using static DotRecast.Detour.DetourCommon;
-namespace DotRecast.Detour.TileCache;
+namespace DotRecast.Detour.TileCache
+{
+
public class TileCacheBuilder {
@@ -42,7 +44,7 @@ public class TileCacheBuilder {
public class LayerMonotoneRegion {
public int area;
- public List neis = new(16);
+ public List neis = new List(16);
public int regId;
public int areaId;
};
@@ -53,9 +55,9 @@ public class TileCacheBuilder {
public List poly;
public TempContour() {
- verts = new();
+ verts = new List();
nverts = 0;
- poly = new();
+ poly = new List();
}
public int npoly() {
@@ -1195,7 +1197,7 @@ public class TileCacheBuilder {
return false;
// Find edges which share the removed vertex.
- List edges = new();
+ List edges = new List();
int nedges = 0;
for (int i = 0; i < mesh.npolys; ++i) {
@@ -1262,10 +1264,10 @@ public class TileCacheBuilder {
}
int nedges = 0;
- List edges = new();
+ List edges = new List();
int nhole = 0;
- List hole = new();
- List harea = new();
+ List hole = new List();
+ List harea = new List();
for (int i = 0; i < mesh.npolys; ++i) {
int p = i * maxVertsPerPoly * 2;
@@ -1841,3 +1843,5 @@ public class TileCacheBuilder {
}
}
+
+}
\ No newline at end of file
diff --git a/src/DotRecast.Detour.TileCache/TileCacheCompressor.cs b/src/DotRecast.Detour.TileCache/TileCacheCompressor.cs
index e662b49..79bb9ae 100644
--- a/src/DotRecast.Detour.TileCache/TileCacheCompressor.cs
+++ b/src/DotRecast.Detour.TileCache/TileCacheCompressor.cs
@@ -17,7 +17,9 @@ freely, subject to the following restrictions:
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
-namespace DotRecast.Detour.TileCache;
+namespace DotRecast.Detour.TileCache
+{
+
public interface TileCacheCompressor {
@@ -25,3 +27,5 @@ public interface TileCacheCompressor {
byte[] compress(byte[] buf);
}
+
+}
\ No newline at end of file
diff --git a/src/DotRecast.Detour.TileCache/TileCacheContour.cs b/src/DotRecast.Detour.TileCache/TileCacheContour.cs
index 976419b..c7b5532 100644
--- a/src/DotRecast.Detour.TileCache/TileCacheContour.cs
+++ b/src/DotRecast.Detour.TileCache/TileCacheContour.cs
@@ -17,7 +17,9 @@ freely, subject to the following restrictions:
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
-namespace DotRecast.Detour.TileCache;
+namespace DotRecast.Detour.TileCache
+{
+
public class TileCacheContour {
public int nverts;
@@ -25,3 +27,5 @@ public class TileCacheContour {
public int reg;
public int area;
}
+
+}
\ No newline at end of file
diff --git a/src/DotRecast.Detour.TileCache/TileCacheContourSet.cs b/src/DotRecast.Detour.TileCache/TileCacheContourSet.cs
index 5ef6a61..426954f 100644
--- a/src/DotRecast.Detour.TileCache/TileCacheContourSet.cs
+++ b/src/DotRecast.Detour.TileCache/TileCacheContourSet.cs
@@ -17,9 +17,13 @@ freely, subject to the following restrictions:
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
-namespace DotRecast.Detour.TileCache;
+namespace DotRecast.Detour.TileCache
+{
+
public class TileCacheContourSet {
public int nconts;
public TileCacheContour[] conts;
}
+
+}
\ No newline at end of file
diff --git a/src/DotRecast.Detour.TileCache/TileCacheLayer.cs b/src/DotRecast.Detour.TileCache/TileCacheLayer.cs
index a0c5ac1..6af1bc6 100644
--- a/src/DotRecast.Detour.TileCache/TileCacheLayer.cs
+++ b/src/DotRecast.Detour.TileCache/TileCacheLayer.cs
@@ -17,7 +17,9 @@ freely, subject to the following restrictions:
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
-namespace DotRecast.Detour.TileCache;
+namespace DotRecast.Detour.TileCache
+{
+
public class TileCacheLayer {
public TileCacheLayerHeader header;
@@ -27,3 +29,5 @@ public class TileCacheLayer {
public short[] cons; // char
public short[] regs; // char
}
+
+}
\ No newline at end of file
diff --git a/src/DotRecast.Detour.TileCache/TileCacheLayerHeader.cs b/src/DotRecast.Detour.TileCache/TileCacheLayerHeader.cs
index 970518f..379a457 100644
--- a/src/DotRecast.Detour.TileCache/TileCacheLayerHeader.cs
+++ b/src/DotRecast.Detour.TileCache/TileCacheLayerHeader.cs
@@ -17,7 +17,9 @@ freely, subject to the following restrictions:
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
-namespace DotRecast.Detour.TileCache;
+namespace DotRecast.Detour.TileCache
+{
+
public class TileCacheLayerHeader {
@@ -34,3 +36,5 @@ public class TileCacheLayerHeader {
public int minx, maxx, miny, maxy; /// < Usable sub-region.
}
+
+}
\ No newline at end of file
diff --git a/src/DotRecast.Detour.TileCache/TileCacheMeshProcess.cs b/src/DotRecast.Detour.TileCache/TileCacheMeshProcess.cs
index eb7310d..d6e2565 100644
--- a/src/DotRecast.Detour.TileCache/TileCacheMeshProcess.cs
+++ b/src/DotRecast.Detour.TileCache/TileCacheMeshProcess.cs
@@ -17,9 +17,13 @@ freely, subject to the following restrictions:
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
-namespace DotRecast.Detour.TileCache;
+namespace DotRecast.Detour.TileCache
+{
+
public interface TileCacheMeshProcess {
void process(NavMeshDataCreateParams option);
}
+
+}
\ No newline at end of file
diff --git a/src/DotRecast.Detour.TileCache/TileCacheObstacle.cs b/src/DotRecast.Detour.TileCache/TileCacheObstacle.cs
index 056ab84..6b619c8 100644
--- a/src/DotRecast.Detour.TileCache/TileCacheObstacle.cs
+++ b/src/DotRecast.Detour.TileCache/TileCacheObstacle.cs
@@ -20,7 +20,9 @@ freely, subject to the following restrictions:
using System.Collections.Generic;
-namespace DotRecast.Detour.TileCache;
+namespace DotRecast.Detour.TileCache
+{
+
public class TileCacheObstacle {
@@ -37,8 +39,8 @@ public class TileCacheObstacle {
public readonly float[] center = new float[3];
public readonly float[] extents = new float[3];
public readonly float[] rotAux = new float[2]; // { cos(0.5f*angle)*sin(-0.5f*angle); cos(0.5f*angle)*cos(0.5f*angle) - 0.5 }
- public List touched = new();
- public readonly List pending = new();
+ public List touched = new List();
+ public readonly List pending = new List();
public int salt;
public ObstacleState state = ObstacleState.DT_OBSTACLE_EMPTY;
public TileCacheObstacle next;
@@ -49,3 +51,5 @@ public class TileCacheObstacle {
}
}
+
+}
\ No newline at end of file
diff --git a/src/DotRecast.Detour.TileCache/TileCacheParams.cs b/src/DotRecast.Detour.TileCache/TileCacheParams.cs
index 58624df..aaa96ff 100644
--- a/src/DotRecast.Detour.TileCache/TileCacheParams.cs
+++ b/src/DotRecast.Detour.TileCache/TileCacheParams.cs
@@ -17,7 +17,9 @@ freely, subject to the following restrictions:
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
-namespace DotRecast.Detour.TileCache;
+namespace DotRecast.Detour.TileCache
+{
+
public class TileCacheParams {
public readonly float[] orig = new float[3];
@@ -31,3 +33,5 @@ public class TileCacheParams {
public int maxObstacles;
}
+
+}
\ No newline at end of file
diff --git a/src/DotRecast.Detour.TileCache/TileCachePolyMesh.cs b/src/DotRecast.Detour.TileCache/TileCachePolyMesh.cs
index ea6ea6c..b6e98c9 100644
--- a/src/DotRecast.Detour.TileCache/TileCachePolyMesh.cs
+++ b/src/DotRecast.Detour.TileCache/TileCachePolyMesh.cs
@@ -17,7 +17,9 @@ freely, subject to the following restrictions:
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
-namespace DotRecast.Detour.TileCache;
+namespace DotRecast.Detour.TileCache
+{
+
public class TileCachePolyMesh {
public int nvp;
@@ -32,3 +34,5 @@ public class TileCachePolyMesh {
this.nvp = nvp;
}
}
+
+}
\ No newline at end of file
diff --git a/src/DotRecast.Detour.TileCache/TileCacheStorageParams.cs b/src/DotRecast.Detour.TileCache/TileCacheStorageParams.cs
index 05ca6db..1fc7a7a 100644
--- a/src/DotRecast.Detour.TileCache/TileCacheStorageParams.cs
+++ b/src/DotRecast.Detour.TileCache/TileCacheStorageParams.cs
@@ -20,7 +20,9 @@ freely, subject to the following restrictions:
using DotRecast.Core;
-namespace DotRecast.Detour.TileCache;
+namespace DotRecast.Detour.TileCache
+{
+
public class TileCacheStorageParams {
@@ -33,3 +35,5 @@ public class TileCacheStorageParams {
}
}
+
+}
\ No newline at end of file
diff --git a/src/DotRecast.Detour/BVNode.cs b/src/DotRecast.Detour/BVNode.cs
index da55ab6..a4e2c09 100644
--- a/src/DotRecast.Detour/BVNode.cs
+++ b/src/DotRecast.Detour/BVNode.cs
@@ -17,7 +17,9 @@ freely, subject to the following restrictions:
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
-namespace DotRecast.Detour;
+namespace DotRecast.Detour
+{
+
/**
* Bounding volume node.
@@ -33,3 +35,5 @@ public class BVNode {
/** The node's index. (Negative for escape sequence.) */
public int i;
}
+
+}
\ No newline at end of file
diff --git a/src/DotRecast.Detour/ClosestPointOnPolyResult.cs b/src/DotRecast.Detour/ClosestPointOnPolyResult.cs
index 2281e47..f877d10 100644
--- a/src/DotRecast.Detour/ClosestPointOnPolyResult.cs
+++ b/src/DotRecast.Detour/ClosestPointOnPolyResult.cs
@@ -17,7 +17,9 @@ freely, subject to the following restrictions:
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
-namespace DotRecast.Detour;
+namespace DotRecast.Detour
+{
+
public class ClosestPointOnPolyResult {
@@ -40,3 +42,5 @@ public class ClosestPointOnPolyResult {
}
}
+
+}
\ No newline at end of file
diff --git a/src/DotRecast.Detour/ConvexConvexIntersection.cs b/src/DotRecast.Detour/ConvexConvexIntersection.cs
index fc05351..1e75653 100644
--- a/src/DotRecast.Detour/ConvexConvexIntersection.cs
+++ b/src/DotRecast.Detour/ConvexConvexIntersection.cs
@@ -18,7 +18,9 @@ freely, subject to the following restrictions:
using System;
-namespace DotRecast.Detour;
+namespace DotRecast.Detour
+{
+
using static DetourCommon;
@@ -235,3 +237,5 @@ public static class ConvexConvexIntersection {
}
}
}
+
+}
\ No newline at end of file
diff --git a/src/DotRecast.Detour/DefaultQueryFilter.cs b/src/DotRecast.Detour/DefaultQueryFilter.cs
index bd67d45..8710e17 100644
--- a/src/DotRecast.Detour/DefaultQueryFilter.cs
+++ b/src/DotRecast.Detour/DefaultQueryFilter.cs
@@ -20,7 +20,9 @@ freely, subject to the following restrictions:
using System;
-namespace DotRecast.Detour;
+namespace DotRecast.Detour
+{
+
using static DetourCommon;
@@ -100,3 +102,5 @@ public class DefaultQueryFilter : QueryFilter {
}
}
+
+}
\ No newline at end of file
diff --git a/src/DotRecast.Detour/DefaultQueryHeuristic.cs b/src/DotRecast.Detour/DefaultQueryHeuristic.cs
index ef66e25..eeba753 100644
--- a/src/DotRecast.Detour/DefaultQueryHeuristic.cs
+++ b/src/DotRecast.Detour/DefaultQueryHeuristic.cs
@@ -16,7 +16,9 @@ freely, subject to the following restrictions:
3. This notice may not be removed or altered from any source distribution.
*/
-namespace DotRecast.Detour;
+namespace DotRecast.Detour
+{
+
using static DetourCommon;
@@ -37,3 +39,5 @@ public class DefaultQueryHeuristic : QueryHeuristic {
}
}
+
+}
\ No newline at end of file
diff --git a/src/DotRecast.Detour/DetourBuilder.cs b/src/DotRecast.Detour/DetourBuilder.cs
index 171bce9..0285366 100644
--- a/src/DotRecast.Detour/DetourBuilder.cs
+++ b/src/DotRecast.Detour/DetourBuilder.cs
@@ -17,7 +17,9 @@ freely, subject to the following restrictions:
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
-namespace DotRecast.Detour;
+namespace DotRecast.Detour
+{
+
public class DetourBuilder {
@@ -30,3 +32,5 @@ public class DetourBuilder {
return data;
}
}
+
+}
\ No newline at end of file
diff --git a/src/DotRecast.Detour/DetourCommon.cs b/src/DotRecast.Detour/DetourCommon.cs
index f9ae688..5b33eb8 100644
--- a/src/DotRecast.Detour/DetourCommon.cs
+++ b/src/DotRecast.Detour/DetourCommon.cs
@@ -20,7 +20,9 @@ freely, subject to the following restrictions:
using System;
-namespace DotRecast.Detour;
+namespace DotRecast.Detour
+{
+
public static class DetourCommon {
@@ -635,3 +637,5 @@ public static class DetourCommon {
}
}
+
+}
\ No newline at end of file
diff --git a/src/DotRecast.Detour/DotRecast.Detour.csproj b/src/DotRecast.Detour/DotRecast.Detour.csproj
index 561560c..2a0ba3b 100644
--- a/src/DotRecast.Detour/DotRecast.Detour.csproj
+++ b/src/DotRecast.Detour/DotRecast.Detour.csproj
@@ -1,7 +1,7 @@
- net7.0
+ netstandard2.1
diff --git a/src/DotRecast.Detour/FindDistanceToWallResult.cs b/src/DotRecast.Detour/FindDistanceToWallResult.cs
index 84f82b4..34be776 100644
--- a/src/DotRecast.Detour/FindDistanceToWallResult.cs
+++ b/src/DotRecast.Detour/FindDistanceToWallResult.cs
@@ -17,7 +17,9 @@ freely, subject to the following restrictions:
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
-namespace DotRecast.Detour;
+namespace DotRecast.Detour
+{
+
//TODO: (PP) Add comments
public class FindDistanceToWallResult {
@@ -43,4 +45,5 @@ public class FindDistanceToWallResult {
return normal;
}
+}
}
\ No newline at end of file
diff --git a/src/DotRecast.Detour/FindLocalNeighbourhoodResult.cs b/src/DotRecast.Detour/FindLocalNeighbourhoodResult.cs
index 235c668..122bdd6 100644
--- a/src/DotRecast.Detour/FindLocalNeighbourhoodResult.cs
+++ b/src/DotRecast.Detour/FindLocalNeighbourhoodResult.cs
@@ -20,7 +20,9 @@ freely, subject to the following restrictions:
using System.Collections.Generic;
-namespace DotRecast.Detour;
+namespace DotRecast.Detour
+{
+
//TODO: (PP) Add comments
public class FindLocalNeighbourhoodResult {
@@ -40,4 +42,5 @@ public class FindLocalNeighbourhoodResult {
return parentRefs;
}
+}
}
\ No newline at end of file
diff --git a/src/DotRecast.Detour/FindNearestPolyQuery.cs b/src/DotRecast.Detour/FindNearestPolyQuery.cs
index c47f75a..ccbd922 100644
--- a/src/DotRecast.Detour/FindNearestPolyQuery.cs
+++ b/src/DotRecast.Detour/FindNearestPolyQuery.cs
@@ -1,6 +1,8 @@
using System;
-namespace DotRecast.Detour;
+namespace DotRecast.Detour
+{
+
using static DetourCommon;
@@ -51,3 +53,5 @@ public class FindNearestPolyQuery : PolyQuery {
}
}
+
+}
\ No newline at end of file
diff --git a/src/DotRecast.Detour/FindNearestPolyResult.cs b/src/DotRecast.Detour/FindNearestPolyResult.cs
index dd45c3b..c2949af 100644
--- a/src/DotRecast.Detour/FindNearestPolyResult.cs
+++ b/src/DotRecast.Detour/FindNearestPolyResult.cs
@@ -17,7 +17,9 @@ freely, subject to the following restrictions:
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
-namespace DotRecast.Detour;
+namespace DotRecast.Detour
+{
+
public class FindNearestPolyResult {
private readonly long nearestRef;
@@ -45,3 +47,5 @@ public class FindNearestPolyResult {
}
}
+
+}
\ No newline at end of file
diff --git a/src/DotRecast.Detour/FindPolysAroundResult.cs b/src/DotRecast.Detour/FindPolysAroundResult.cs
index d848d81..75196ce 100644
--- a/src/DotRecast.Detour/FindPolysAroundResult.cs
+++ b/src/DotRecast.Detour/FindPolysAroundResult.cs
@@ -20,7 +20,9 @@ freely, subject to the following restrictions:
using System.Collections.Generic;
-namespace DotRecast.Detour;
+namespace DotRecast.Detour
+{
+
// TODO: (PP) Add comments
@@ -47,4 +49,5 @@ public class FindPolysAroundResult {
return costs;
}
+}
}
\ No newline at end of file
diff --git a/src/DotRecast.Detour/FindRandomPointResult.cs b/src/DotRecast.Detour/FindRandomPointResult.cs
index 5c2cbc9..db295e3 100644
--- a/src/DotRecast.Detour/FindRandomPointResult.cs
+++ b/src/DotRecast.Detour/FindRandomPointResult.cs
@@ -17,7 +17,9 @@ freely, subject to the following restrictions:
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
-namespace DotRecast.Detour;
+namespace DotRecast.Detour
+{
+
//TODO: (PP) Add comments
public class FindRandomPointResult {
@@ -39,4 +41,5 @@ public class FindRandomPointResult {
return randomPt;
}
+}
}
\ No newline at end of file
diff --git a/src/DotRecast.Detour/GetPolyWallSegmentsResult.cs b/src/DotRecast.Detour/GetPolyWallSegmentsResult.cs
index e466417..7f7bef2 100644
--- a/src/DotRecast.Detour/GetPolyWallSegmentsResult.cs
+++ b/src/DotRecast.Detour/GetPolyWallSegmentsResult.cs
@@ -20,7 +20,9 @@ freely, subject to the following restrictions:
using System.Collections.Generic;
-namespace DotRecast.Detour;
+namespace DotRecast.Detour
+{
+
public class GetPolyWallSegmentsResult {
@@ -42,3 +44,5 @@ public class GetPolyWallSegmentsResult {
}
}
+
+}
\ No newline at end of file
diff --git a/src/DotRecast.Detour/Io/DetourWriter.cs b/src/DotRecast.Detour/Io/DetourWriter.cs
index 6fb490b..da411c8 100644
--- a/src/DotRecast.Detour/Io/DetourWriter.cs
+++ b/src/DotRecast.Detour/Io/DetourWriter.cs
@@ -20,7 +20,9 @@ using System;
using System.IO;
using DotRecast.Core;
-namespace DotRecast.Detour.Io;
+namespace DotRecast.Detour.Io
+{
+
public abstract class DetourWriter {
@@ -42,11 +44,11 @@ public abstract class DetourWriter {
protected void write(BinaryWriter stream, long value, ByteOrder order) {
if (order == ByteOrder.BIG_ENDIAN) {
- write(stream, (int) (value >>> 32), order);
+ write(stream, (int) ((ulong)value >> 32), order);
write(stream, (int) (value & 0xFFFFFFFF), order);
} else {
write(stream, (int) (value & 0xFFFFFFFF), order);
- write(stream, (int) (value >>> 32), order);
+ write(stream, (int) ((ulong)value >> 32), order);
}
}
@@ -80,3 +82,5 @@ public abstract class DetourWriter {
}
}
+
+}
\ No newline at end of file
diff --git a/src/DotRecast.Detour/Io/IOUtils.cs b/src/DotRecast.Detour/Io/IOUtils.cs
index 76a65ad..85986a6 100644
--- a/src/DotRecast.Detour/Io/IOUtils.cs
+++ b/src/DotRecast.Detour/Io/IOUtils.cs
@@ -20,7 +20,9 @@ using System;
using System.IO;
using DotRecast.Core;
-namespace DotRecast.Detour.Io;
+namespace DotRecast.Detour.Io
+{
+
public static class IOUtils {
@@ -51,8 +53,11 @@ public static class IOUtils {
return new ByteBuffer(bytes);
}
- public static int swapEndianness(int i) {
- var s = ((i >>> 24) & 0xFF) | ((i>>8) & 0xFF00) | ((i<<8) & 0xFF0000) | ((i << 24) & 0xFF000000);
+ public static int swapEndianness(int i)
+ {
+ var s = (((uint)i >> 24) & 0xFF) | (((uint)i>>8) & 0xFF00) | (((uint)i<<8) & 0xFF0000) | ((i << 24) & 0xFF000000);
return (int)s;
}
}
+
+}
\ No newline at end of file
diff --git a/src/DotRecast.Detour/Io/MeshDataReader.cs b/src/DotRecast.Detour/Io/MeshDataReader.cs
index 75654a3..5f297e0 100644
--- a/src/DotRecast.Detour/Io/MeshDataReader.cs
+++ b/src/DotRecast.Detour/Io/MeshDataReader.cs
@@ -19,7 +19,9 @@ freely, subject to the following restrictions:
using System.IO;
using DotRecast.Core;
-namespace DotRecast.Detour.Io;
+namespace DotRecast.Detour.Io
+{
+
public class MeshDataReader {
@@ -199,3 +201,5 @@ public class MeshDataReader {
}
}
+
+}
\ No newline at end of file
diff --git a/src/DotRecast.Detour/Io/MeshDataWriter.cs b/src/DotRecast.Detour/Io/MeshDataWriter.cs
index 0416eee..69f58b4 100644
--- a/src/DotRecast.Detour/Io/MeshDataWriter.cs
+++ b/src/DotRecast.Detour/Io/MeshDataWriter.cs
@@ -19,7 +19,9 @@ freely, subject to the following restrictions:
using System.IO;
using DotRecast.Core;
-namespace DotRecast.Detour.Io;
+namespace DotRecast.Detour.Io
+{
+
public class MeshDataWriter : DetourWriter {
@@ -140,3 +142,5 @@ public class MeshDataWriter : DetourWriter {
}
}
+
+}
\ No newline at end of file
diff --git a/src/DotRecast.Detour/Io/MeshSetReader.cs b/src/DotRecast.Detour/Io/MeshSetReader.cs
index 1dc92d0..b1b8a80 100644
--- a/src/DotRecast.Detour/Io/MeshSetReader.cs
+++ b/src/DotRecast.Detour/Io/MeshSetReader.cs
@@ -20,7 +20,9 @@ using System;
using System.IO;
using DotRecast.Core;
-namespace DotRecast.Detour.Io;
+namespace DotRecast.Detour.Io
+{
+
using static DetourCommon;
@@ -125,3 +127,5 @@ public class MeshSetReader {
return NavMesh.encodePolyId(salt, it, ip);
}
}
+
+}
\ No newline at end of file
diff --git a/src/DotRecast.Detour/Io/MeshSetWriter.cs b/src/DotRecast.Detour/Io/MeshSetWriter.cs
index d0135d0..b3dacbc 100644
--- a/src/DotRecast.Detour/Io/MeshSetWriter.cs
+++ b/src/DotRecast.Detour/Io/MeshSetWriter.cs
@@ -19,7 +19,9 @@ freely, subject to the following restrictions:
using System.IO;
using DotRecast.Core;
-namespace DotRecast.Detour.Io;
+namespace DotRecast.Detour.Io
+{
+
public class MeshSetWriter : DetourWriter {
@@ -76,3 +78,5 @@ public class MeshSetWriter : DetourWriter {
}
}
+
+}
\ No newline at end of file
diff --git a/src/DotRecast.Detour/Io/NavMeshParamReader.cs b/src/DotRecast.Detour/Io/NavMeshParamReader.cs
index 54e39a9..a28f0b0 100644
--- a/src/DotRecast.Detour/Io/NavMeshParamReader.cs
+++ b/src/DotRecast.Detour/Io/NavMeshParamReader.cs
@@ -1,6 +1,8 @@
using DotRecast.Core;
-namespace DotRecast.Detour.Io;
+namespace DotRecast.Detour.Io
+{
+
public class NavMeshParamReader {
@@ -17,3 +19,5 @@ public class NavMeshParamReader {
}
}
+
+}
\ No newline at end of file
diff --git a/src/DotRecast.Detour/Io/NavMeshParamWriter.cs b/src/DotRecast.Detour/Io/NavMeshParamWriter.cs
index 8fac183..8f0fc65 100644
--- a/src/DotRecast.Detour/Io/NavMeshParamWriter.cs
+++ b/src/DotRecast.Detour/Io/NavMeshParamWriter.cs
@@ -1,7 +1,9 @@
using System.IO;
using DotRecast.Core;
-namespace DotRecast.Detour.Io;
+namespace DotRecast.Detour.Io
+{
+
public class NavMeshParamWriter : DetourWriter {
@@ -16,3 +18,5 @@ public class NavMeshParamWriter : DetourWriter {
}
}
+
+}
\ No newline at end of file
diff --git a/src/DotRecast.Detour/Io/NavMeshSetHeader.cs b/src/DotRecast.Detour/Io/NavMeshSetHeader.cs
index ab2fc44..e2480e7 100644
--- a/src/DotRecast.Detour/Io/NavMeshSetHeader.cs
+++ b/src/DotRecast.Detour/Io/NavMeshSetHeader.cs
@@ -15,7 +15,9 @@ freely, subject to the following restrictions:
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
-namespace DotRecast.Detour.Io;
+namespace DotRecast.Detour.Io
+{
+
public class NavMeshSetHeader {
@@ -31,3 +33,5 @@ public class NavMeshSetHeader {
public int maxVertsPerPoly;
}
+
+}
\ No newline at end of file
diff --git a/src/DotRecast.Detour/Io/NavMeshTileHeader.cs b/src/DotRecast.Detour/Io/NavMeshTileHeader.cs
index 3613c3f..69f70cd 100644
--- a/src/DotRecast.Detour/Io/NavMeshTileHeader.cs
+++ b/src/DotRecast.Detour/Io/NavMeshTileHeader.cs
@@ -1,6 +1,10 @@
-namespace DotRecast.Detour.Io;
+namespace DotRecast.Detour.Io
+{
+
public class NavMeshTileHeader {
public long tileRef;
public int dataSize;
}
+
+}
\ No newline at end of file
diff --git a/src/DotRecast.Detour/LegacyNavMeshQuery.cs b/src/DotRecast.Detour/LegacyNavMeshQuery.cs
index e11bc0a..0ab6cc1 100644
--- a/src/DotRecast.Detour/LegacyNavMeshQuery.cs
+++ b/src/DotRecast.Detour/LegacyNavMeshQuery.cs
@@ -19,7 +19,9 @@ freely, subject to the following restrictions:
using System;
using System.Collections.Generic;
-namespace DotRecast.Detour;
+namespace DotRecast.Detour
+{
+
using static DetourCommon;
@@ -45,7 +47,7 @@ public class LegacyNavMeshQuery : NavMeshQuery {
}
if (startRef == endRef) {
- List singlePath = new(1);
+ List singlePath = new List(1);
singlePath.Add(startRef);
return Results.success(singlePath);
}
@@ -412,7 +414,7 @@ public class LegacyNavMeshQuery : NavMeshQuery {
/// @returns The status flags for the query.
public override Result> finalizeSlicedFindPath() {
- List path = new(64);
+ List path = new List(64);
if (m_query.status.isFailed()) {
// Reset query.
m_query = new QueryData();
@@ -480,7 +482,7 @@ public class LegacyNavMeshQuery : NavMeshQuery {
/// @returns The status flags for the query.
public override Result> finalizeSlicedFindPathPartial(List existing) {
- List path = new(64);
+ List path = new List(64);
if (null == existing || existing.Count <= 0) {
return Results.failure(path);
}
@@ -728,3 +730,5 @@ public class LegacyNavMeshQuery : NavMeshQuery {
return Results.success(new FindDistanceToWallResult((float) Math.Sqrt(radiusSqr), hitPos, hitNormal));
}
}
+
+}
\ No newline at end of file
diff --git a/src/DotRecast.Detour/Link.cs b/src/DotRecast.Detour/Link.cs
index bf6fc85..7d3a400 100644
--- a/src/DotRecast.Detour/Link.cs
+++ b/src/DotRecast.Detour/Link.cs
@@ -17,7 +17,9 @@ freely, subject to the following restrictions:
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
-namespace DotRecast.Detour;
+namespace DotRecast.Detour
+{
+
/**
* Defines a link between polygons.
@@ -40,3 +42,5 @@ public class Link {
public int bmax;
}
+
+}
\ No newline at end of file
diff --git a/src/DotRecast.Detour/MeshData.cs b/src/DotRecast.Detour/MeshData.cs
index 1e96e1e..8282fe4 100644
--- a/src/DotRecast.Detour/MeshData.cs
+++ b/src/DotRecast.Detour/MeshData.cs
@@ -17,7 +17,9 @@ freely, subject to the following restrictions:
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
-namespace DotRecast.Detour;
+namespace DotRecast.Detour
+{
+
public class MeshData {
@@ -43,4 +45,5 @@ public class MeshData {
/** The tile off-mesh connections. [Size: MeshHeader::offMeshConCount] */
public OffMeshConnection[] offMeshCons;
+}
}
\ No newline at end of file
diff --git a/src/DotRecast.Detour/MeshHeader.cs b/src/DotRecast.Detour/MeshHeader.cs
index 1c36c14..df9911b 100644
--- a/src/DotRecast.Detour/MeshHeader.cs
+++ b/src/DotRecast.Detour/MeshHeader.cs
@@ -17,7 +17,9 @@ freely, subject to the following restrictions:
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
-namespace DotRecast.Detour;
+namespace DotRecast.Detour
+{
+
/** Provides high level information related to a dtMeshTile object. */
public class MeshHeader {
@@ -77,3 +79,5 @@ public class MeshHeader {
/** The bounding volume quantization factor. */
public float bvQuantFactor;
}
+
+}
\ No newline at end of file
diff --git a/src/DotRecast.Detour/MeshTile.cs b/src/DotRecast.Detour/MeshTile.cs
index 2c63ed9..e34d49e 100644
--- a/src/DotRecast.Detour/MeshTile.cs
+++ b/src/DotRecast.Detour/MeshTile.cs
@@ -20,7 +20,9 @@ freely, subject to the following restrictions:
using System.Collections.Generic;
-namespace DotRecast.Detour;
+namespace DotRecast.Detour
+{
+
/**
* Defines a navigation mesh tile.
@@ -33,7 +35,7 @@ public class MeshTile {
public MeshData data;
public int[] polyLinks;
/** The tile links. */
- public readonly List links = new();
+ public readonly List links = new List();
/** Index to the next free link. */
public int linksFreeList = NavMesh.DT_NULL_LINK; // FIXME: Remove
/** Tile flags. (See: #dtTileFlags) */
@@ -44,3 +46,5 @@ public class MeshTile {
}
}
+
+}
\ No newline at end of file
diff --git a/src/DotRecast.Detour/MoveAlongSurfaceResult.cs b/src/DotRecast.Detour/MoveAlongSurfaceResult.cs
index bff157d..5526fe0 100644
--- a/src/DotRecast.Detour/MoveAlongSurfaceResult.cs
+++ b/src/DotRecast.Detour/MoveAlongSurfaceResult.cs
@@ -20,7 +20,9 @@ freely, subject to the following restrictions:
using System.Collections.Generic;
-namespace DotRecast.Detour;
+namespace DotRecast.Detour
+{
+
public class MoveAlongSurfaceResult {
@@ -44,3 +46,5 @@ public class MoveAlongSurfaceResult {
}
}
+
+}
\ No newline at end of file
diff --git a/src/DotRecast.Detour/NavMesh.cs b/src/DotRecast.Detour/NavMesh.cs
index 27e7985..26e3562 100644
--- a/src/DotRecast.Detour/NavMesh.cs
+++ b/src/DotRecast.Detour/NavMesh.cs
@@ -23,7 +23,9 @@ using System.Collections.Generic;
using System.Collections.Immutable;
using DotRecast.Core;
-namespace DotRecast.Detour;
+namespace DotRecast.Detour
+{
+
using static DetourCommon;
@@ -58,8 +60,8 @@ public class NavMesh {
float m_tileWidth, m_tileHeight; /// < Dimensions of each tile.
int m_maxTiles; /// < Max number of tiles.
private readonly int m_tileLutMask; /// < Tile hash lookup mask.
- private readonly Dictionary> posLookup = new();
- private readonly LinkedList availableTiles = new();
+ private readonly Dictionary> posLookup = new Dictionary>();
+ private readonly LinkedList availableTiles = new LinkedList();
private readonly MeshTile[] m_tiles; /// < List of tiles.
/** The maximum number of vertices per navigation polygon. */
private readonly int m_maxVertPerPoly;
@@ -285,7 +287,7 @@ public class NavMesh {
// for off-mesh connection finding.
List queryPolygonsInTile(MeshTile tile, float[] qmin, float[] qmax) {
- List polys = new();
+ List polys = new List();
if (tile.data.bvTree != null) {
int nodeIndex = 0;
float[] tbmin = tile.data.header.bmin;
@@ -756,7 +758,7 @@ public class NavMesh {
if (tile == null) {
return ImmutableArray>.Empty;
}
- List> result = new();
+ List> result = new List>();
float[] amin = new float[2];
float[] amax = new float[2];
calcSlabEndPoints(verts, va, vb, amin, amax, side);
@@ -1195,7 +1197,7 @@ public class NavMesh {
}
public List getTilesAt(int x, int y) {
- List tiles = new();
+ List tiles = new List();
foreach (MeshTile tile in getTileListByPos(x, y)) {
if (tile.data.header != null && tile.data.header.x == x && tile.data.header.y == y) {
tiles.Add(tile);
@@ -1418,10 +1420,12 @@ public class NavMesh {
var tileHash = computeTileHash(x, z, m_tileLutMask);
if (!posLookup.TryGetValue(tileHash, out var tiles))
{
- tiles = new();
+ tiles = new List();
posLookup.Add(tileHash, tiles);
}
return tiles;
}
}
+
+}
\ No newline at end of file
diff --git a/src/DotRecast.Detour/NavMeshBuilder.cs b/src/DotRecast.Detour/NavMeshBuilder.cs
index 2212787..c9bfdc6 100644
--- a/src/DotRecast.Detour/NavMeshBuilder.cs
+++ b/src/DotRecast.Detour/NavMeshBuilder.cs
@@ -21,7 +21,9 @@ freely, subject to the following restrictions:
using System;
using System.Collections.Generic;
-namespace DotRecast.Detour;
+namespace DotRecast.Detour
+{
+
using static DetourCommon;
@@ -600,3 +602,5 @@ public class NavMeshBuilder {
}
}
+
+}
\ No newline at end of file
diff --git a/src/DotRecast.Detour/NavMeshDataCreateParams.cs b/src/DotRecast.Detour/NavMeshDataCreateParams.cs
index 285dd02..e285ce0 100644
--- a/src/DotRecast.Detour/NavMeshDataCreateParams.cs
+++ b/src/DotRecast.Detour/NavMeshDataCreateParams.cs
@@ -17,7 +17,9 @@ freely, subject to the following restrictions:
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
-namespace DotRecast.Detour;
+namespace DotRecast.Detour
+{
+
/// Represents the source data used to build an navigation mesh tile.
public class NavMeshDataCreateParams {
@@ -99,4 +101,5 @@ public class NavMeshDataCreateParams {
/// @}
+}
}
\ No newline at end of file
diff --git a/src/DotRecast.Detour/NavMeshParams.cs b/src/DotRecast.Detour/NavMeshParams.cs
index 79ac3b3..50daa72 100644
--- a/src/DotRecast.Detour/NavMeshParams.cs
+++ b/src/DotRecast.Detour/NavMeshParams.cs
@@ -17,7 +17,9 @@ freely, subject to the following restrictions:
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
-namespace DotRecast.Detour;
+namespace DotRecast.Detour
+{
+
/**
* Configuration parameters used to define multi-tile navigation meshes. The values are used to allocate space during
@@ -37,3 +39,5 @@ public class NavMeshParams {
/** The maximum number of polygons each tile can contain. */
public int maxPolys;
}
+
+}
\ No newline at end of file
diff --git a/src/DotRecast.Detour/NavMeshQuery.cs b/src/DotRecast.Detour/NavMeshQuery.cs
index 06e7cc9..b3d53e6 100644
--- a/src/DotRecast.Detour/NavMeshQuery.cs
+++ b/src/DotRecast.Detour/NavMeshQuery.cs
@@ -22,7 +22,9 @@ using System;
using System.Collections.Generic;
using System.Collections.Immutable;
-namespace DotRecast.Detour;
+namespace DotRecast.Detour
+{
+
using static DetourCommon;
using static Node;
@@ -636,7 +638,7 @@ public class NavMeshQuery {
int[] maxxy = m_nav.calcTileLoc(bmax);
int maxx = maxxy[0];
int maxy = maxxy[1];
- List tiles = new();
+ List tiles = new List();
for (int y = miny; y <= maxy; ++y) {
for (int x = minx; x <= maxx; ++x) {
tiles.AddRange(m_nav.getTilesAt(x, y));
@@ -694,7 +696,7 @@ public class NavMeshQuery {
}
if (startRef == endRef) {
- List singlePath = new(1);
+ List singlePath = new List(1);
singlePath.Add(startRef);
return Results.success(singlePath);
}
@@ -1181,7 +1183,7 @@ public class NavMeshQuery {
/// @returns The status flags for the query.
public virtual Result> finalizeSlicedFindPath() {
- List path = new(64);
+ List path = new List(64);
if (m_query.status.isFailed()) {
// Reset query.
m_query = new QueryData();
@@ -1215,7 +1217,7 @@ public class NavMeshQuery {
/// @returns The status flags for the query.
public virtual Result> finalizeSlicedFindPathPartial(List existing) {
- List path = new(64);
+ List path = new List(64);
if (null == existing || existing.Count <= 0) {
return Results.failure(path);
}
@@ -1350,7 +1352,7 @@ public class NavMeshQuery {
public virtual Result> findStraightPath(float[] startPos, float[] endPos, List path,
int maxStraightPath, int options) {
- List straightPath = new();
+ List straightPath = new List();
if (null == startPos || !vIsFinite(startPos) || null == endPos || !vIsFinite(endPos)
|| null == path || 0 == path.Count || path[0] == 0 || maxStraightPath <= 0) {
return Results.invalidParam>();
@@ -1578,7 +1580,7 @@ public class NavMeshQuery {
startNode.total = 0;
startNode.id = startRef;
startNode.flags = Node.DT_NODE_CLOSED;
- LinkedList stack = new();
+ LinkedList stack = new LinkedList();
stack.AddLast(startNode);
float[] bestPos = new float[3];
@@ -1690,7 +1692,7 @@ public class NavMeshQuery {
}
}
- List visited = new();
+ List visited = new List();
if (bestNode != null) {
// Reverse the path.
Node prev = null;
@@ -2157,9 +2159,9 @@ public class NavMeshQuery {
return Results.invalidParam();
}
- List resultRef = new();
- List resultParent = new();
- List resultCost = new();
+ List resultRef = new List();
+ List resultParent = new List();
+ List resultCost = new List();
m_nodePool.clear();
m_openList.clear();
@@ -2316,9 +2318,9 @@ public class NavMeshQuery {
return Results.invalidParam();
}
- List resultRef = new();
- List resultParent = new();
- List resultCost = new();
+ List resultRef = new List();
+ List resultParent = new List();
+ List resultCost = new List();
m_nodePool.clear();
m_openList.clear();
@@ -2488,8 +2490,8 @@ public class NavMeshQuery {
return Results.invalidParam();
}
- List resultRef = new();
- List