This commit is contained in:
in0finite 2022-02-19 22:48:27 +01:00
parent 4e3fc521fb
commit 813dccfe0c
2 changed files with 9 additions and 9 deletions

View file

@ -23,7 +23,14 @@ namespace SanAndreasUnity.Behaviours
public float TimeElapsed { get; set; }
}
public class NodeComparer : IComparer<PathNodeId>
private struct NodePathfindingData
{
public float f, g;
public PathNodeId parentId;
public bool hasParent;
}
private class NodeComparer : IComparer<PathNodeId>
{
private readonly NodePathfindingData[][] m_nodePathfindingDatas;
@ -137,7 +144,7 @@ namespace SanAndreasUnity.Behaviours
pathResult.TimeElapsed = (float)stopwatch.Elapsed.TotalSeconds;
UnityEngine.Debug.Log($"Path finding finished: time {pathResult.TimeElapsed}, num nodes {pathResult.Nodes?.Count ?? 0}, numModifiedDatas {numModifiedDatas}, g {pathResult.TotalWeight}, distance {pathResult.Distance}");
UnityEngine.Debug.Log($"Path finding finished: time {pathResult.TimeElapsed * 1000} ms, num nodes {pathResult.Nodes?.Count ?? 0}, numModifiedDatas {numModifiedDatas}, g {pathResult.TotalWeight}, distance {pathResult.Distance}");
return pathResult;
}

View file

@ -52,13 +52,6 @@ namespace SanAndreasUnity.Importing.Paths
public static PathNodeId InvalidId => new PathNodeId { AreaID = -1, NodeID = -1 };
}
public struct NodePathfindingData
{
public float f, g;
public PathNodeId parentId;
public bool hasParent;
}
public struct PathNode : IEquatable<PathNode>
{
public UnityEngine.Vector3 Position { get; set; }