forked from bit/DotRecastNetSim
class PortablResult -> struct
This commit is contained in:
parent
332753ba23
commit
136c8d040d
|
@ -1975,22 +1975,6 @@ namespace DotRecast.Detour
|
||||||
return Results.Success(new MoveAlongSurfaceResult(bestPos, visited));
|
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<PortalResult> getPortalPoints(long from, long to)
|
protected Result<PortalResult> getPortalPoints(long from, long to)
|
||||||
{
|
{
|
||||||
Result<Tuple<MeshTile, Poly>> tileAndPolyResult = m_nav.getTileAndPolyByRef(from);
|
Result<Tuple<MeshTile, Poly>> tileAndPolyResult = m_nav.getTileAndPolyByRef(from);
|
||||||
|
@ -3305,9 +3289,9 @@ namespace DotRecast.Detour
|
||||||
// Calculate hit pos.
|
// Calculate hit pos.
|
||||||
hitPos.x = bestTile.data.verts[vj] + (bestTile.data.verts[vi] - bestTile.data.verts[vj]) * tseg;
|
hitPos.x = bestTile.data.verts[vj] + (bestTile.data.verts[vi] - bestTile.data.verts[vj]) * tseg;
|
||||||
hitPos.y = bestTile.data.verts[vj + 1]
|
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]
|
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);
|
bestvj = new VectorPtr(bestTile.data.verts, vj);
|
||||||
bestvi = new VectorPtr(bestTile.data.verts, vi);
|
bestvi = new VectorPtr(bestTile.data.verts, vi);
|
||||||
}
|
}
|
||||||
|
@ -3523,4 +3507,4 @@ namespace DotRecast.Detour
|
||||||
return m_nodePool;
|
return m_nodePool;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue