diff --git a/src/DotRecast.Detour/NavMeshQuery.cs b/src/DotRecast.Detour/NavMeshQuery.cs index 77f30b9..17741ed 100644 --- a/src/DotRecast.Detour/NavMeshQuery.cs +++ b/src/DotRecast.Detour/NavMeshQuery.cs @@ -1975,22 +1975,6 @@ namespace DotRecast.Detour return Results.Success(new MoveAlongSurfaceResult(bestPos, visited)); } - public class PortalResult - { - public readonly Vector3f left; - public readonly Vector3f right; - public readonly int fromType; - public readonly int toType; - - public PortalResult(Vector3f left, Vector3f right, int fromType, int toType) - { - this.left = left; - this.right = right; - this.fromType = fromType; - this.toType = toType; - } - } - protected Result getPortalPoints(long from, long to) { Result> tileAndPolyResult = m_nav.getTileAndPolyByRef(from); @@ -3305,9 +3289,9 @@ namespace DotRecast.Detour // Calculate hit pos. hitPos.x = bestTile.data.verts[vj] + (bestTile.data.verts[vi] - bestTile.data.verts[vj]) * tseg; hitPos.y = bestTile.data.verts[vj + 1] - + (bestTile.data.verts[vi + 1] - bestTile.data.verts[vj + 1]) * tseg; + + (bestTile.data.verts[vi + 1] - bestTile.data.verts[vj + 1]) * tseg; hitPos.z = bestTile.data.verts[vj + 2] - + (bestTile.data.verts[vi + 2] - bestTile.data.verts[vj + 2]) * tseg; + + (bestTile.data.verts[vi + 2] - bestTile.data.verts[vj + 2]) * tseg; bestvj = new VectorPtr(bestTile.data.verts, vj); bestvi = new VectorPtr(bestTile.data.verts, vi); } @@ -3523,4 +3507,4 @@ namespace DotRecast.Detour return m_nodePool; } } -} +} \ No newline at end of file diff --git a/src/DotRecast.Detour/QueryResults/PortalResult.cs b/src/DotRecast.Detour/QueryResults/PortalResult.cs new file mode 100644 index 0000000..fc37035 --- /dev/null +++ b/src/DotRecast.Detour/QueryResults/PortalResult.cs @@ -0,0 +1,20 @@ +using DotRecast.Core; + +namespace DotRecast.Detour.QueryResults +{ + public struct PortalResult + { + public readonly Vector3f left; + public readonly Vector3f right; + public readonly int fromType; + public readonly int toType; + + public PortalResult(Vector3f left, Vector3f right, int fromType, int toType) + { + this.left = left; + this.right = right; + this.fromType = fromType; + this.toType = toType; + } + } +} \ No newline at end of file