Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix typo #25

Merged
merged 1 commit into from
Dec 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/DotRecast.Detour/DtNavMesh.cs
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ public DtStatus GetTileAndPolyByRef(long refs, out DtMeshTile tile, out DtPoly p
tile = m_tiles[it];
poly = m_tiles[it].data.polys[ip];

return DtStatus.DT_SUCCSESS;
return DtStatus.DT_SUCCESS;
}

/// @par
Expand Down Expand Up @@ -1586,7 +1586,7 @@ public DtStatus GetOffMeshConnectionPolyEndPoints(long prevRef, long polyRef, re
startPos = RcVecUtils.Create(tile.data.verts, poly.verts[idx0] * 3);
endPos = RcVecUtils.Create(tile.data.verts, poly.verts[idx1] * 3);

return DtStatus.DT_SUCCSESS;
return DtStatus.DT_SUCCESS;
}

public int GetMaxVertsPerPoly()
Expand Down Expand Up @@ -1632,7 +1632,7 @@ public DtStatus SetPolyFlags(long refs, int flags)

// Change flags.
poly.flags = flags;
return DtStatus.DT_SUCCSESS;
return DtStatus.DT_SUCCESS;
}

/// Gets the user defined flags for the specified polygon.
Expand Down Expand Up @@ -1669,7 +1669,7 @@ public DtStatus GetPolyFlags(long refs, out int resultFlags)

resultFlags = poly.flags;

return DtStatus.DT_SUCCSESS;
return DtStatus.DT_SUCCESS;
}

public DtStatus SetPolyArea(long refs, char area)
Expand Down Expand Up @@ -1700,7 +1700,7 @@ public DtStatus SetPolyArea(long refs, char area)

poly.SetArea(area);

return DtStatus.DT_SUCCSESS;
return DtStatus.DT_SUCCESS;
}

public DtStatus GetPolyArea(long refs, out int resultArea)
Expand Down Expand Up @@ -1732,7 +1732,7 @@ public DtStatus GetPolyArea(long refs, out int resultArea)
DtPoly poly = tile.data.polys[ip];
resultArea = poly.GetArea();

return DtStatus.DT_SUCCSESS;
return DtStatus.DT_SUCCESS;
}

public RcVec3f GetPolyCenter(long refs)
Expand Down
66 changes: 33 additions & 33 deletions src/DotRecast.Detour/DtNavMeshQuery.cs
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ public DtStatus FindRandomPoint(IDtQueryFilter filter, IRcRand frand, out long r
randomRef = polyRef;
randomPt = closest;

return DtStatus.DT_SUCCSESS;
return DtStatus.DT_SUCCESS;
}

/**
Expand Down Expand Up @@ -229,7 +229,7 @@ public DtStatus FindRandomPointAroundCircle(long startRef, RcVec3f centerPos, fl
startNode.flags = DtNodeFlags.DT_NODE_OPEN;
m_openList.Push(startNode);

DtStatus status = DtStatus.DT_SUCCSESS;
DtStatus status = DtStatus.DT_SUCCESS;

float radiusSqr = maxRadius * maxRadius;
float areaSum = 0.0f;
Expand Down Expand Up @@ -412,7 +412,7 @@ public DtStatus ClosestPointOnPoly(long refs, RcVec3f pos, out RcVec3f closest,
}

m_nav.ClosestPointOnPoly(refs, pos, out closest, out posOverPoly);
return DtStatus.DT_SUCCSESS;
return DtStatus.DT_SUCCESS;
}

/// @par
Expand Down Expand Up @@ -479,7 +479,7 @@ public DtStatus ClosestPointOnPolyBoundary(long refs, RcVec3f pos, out RcVec3f c
closest = RcVecUtils.Lerp(verts, va, vb, edget[imin]);
}

return DtStatus.DT_SUCCSESS;
return DtStatus.DT_SUCCESS;
}

/// @par
Expand Down Expand Up @@ -519,7 +519,7 @@ public DtStatus GetPolyHeight(long refs, RcVec3f pos, out float height)
DtUtils.DistancePtSegSqr2D(pos, v0, v1, out var t);
height = v0.Y + (v1.Y - v0.Y) * t;

return DtStatus.DT_SUCCSESS;
return DtStatus.DT_SUCCESS;
}

if (!m_nav.GetPolyHeight(tile, poly, pos, out var h))
Expand All @@ -528,7 +528,7 @@ public DtStatus GetPolyHeight(long refs, RcVec3f pos, out float height)
}

height = h;
return DtStatus.DT_SUCCSESS;
return DtStatus.DT_SUCCESS;
}

/// Finds the polygon nearest to the specified center point.
Expand Down Expand Up @@ -560,7 +560,7 @@ public DtStatus FindNearestPoly(RcVec3f center, RcVec3f halfExtents, IDtQueryFil
nearestPt = query.NearestPt();
isOverPoly = query.OverPoly();

return DtStatus.DT_SUCCSESS;
return DtStatus.DT_SUCCESS;
}

// FIXME: (PP) duplicate?
Expand Down Expand Up @@ -686,7 +686,7 @@ public DtStatus QueryPolygons(RcVec3f center, RcVec3f halfExtents, IDtQueryFilte
QueryPolygonsInTile(t, bmin, bmax, filter, query);
}

return DtStatus.DT_SUCCSESS;
return DtStatus.DT_SUCCESS;
}

/**
Expand Down Expand Up @@ -768,7 +768,7 @@ public DtStatus FindPath(long startRef, long endRef, RcVec3f startPos, RcVec3f e
if (startRef == endRef)
{
path.Add(startRef);
return DtStatus.DT_SUCCSESS;
return DtStatus.DT_SUCCESS;
}

m_nodePool.Clear();
Expand Down Expand Up @@ -1037,8 +1037,8 @@ public DtStatus InitSlicedFindPath(long startRef, long endRef, RcVec3f startPos,

if (startRef == endRef)
{
m_query.status = DtStatus.DT_SUCCSESS;
return DtStatus.DT_SUCCSESS;
m_query.status = DtStatus.DT_SUCCESS;
return DtStatus.DT_SUCCESS;
}

m_nodePool.Clear();
Expand Down Expand Up @@ -1097,7 +1097,7 @@ public virtual DtStatus UpdateSlicedFindPath(int maxIter, out int doneIters)
{
m_query.lastBestNode = bestNode;
var details = m_query.status & DtStatus.DT_STATUS_DETAIL_MASK;
m_query.status = DtStatus.DT_SUCCSESS | details;
m_query.status = DtStatus.DT_SUCCESS | details;
doneIters = iter;
return m_query.status;
}
Expand Down Expand Up @@ -1295,7 +1295,7 @@ public virtual DtStatus UpdateSlicedFindPath(int maxIter, out int doneIters)
if (m_openList.IsEmpty())
{
var details = m_query.status & DtStatus.DT_STATUS_DETAIL_MASK;
m_query.status = DtStatus.DT_SUCCSESS | details;
m_query.status = DtStatus.DT_SUCCESS | details;
}

doneIters = iter;
Expand Down Expand Up @@ -1341,7 +1341,7 @@ public virtual DtStatus FinalizeSlicedFindPath(ref List<long> path)
// Reset query.
m_query = new DtQueryData();

return DtStatus.DT_SUCCSESS | details;
return DtStatus.DT_SUCCESS | details;
}

/// Finalizes and returns the results of an incomplete sliced path query, returning the path to the furthest
Expand Down Expand Up @@ -1402,7 +1402,7 @@ public virtual DtStatus FinalizeSlicedFindPathPartial(List<long> existing, ref L
// Reset query.
m_query = new DtQueryData();

return DtStatus.DT_SUCCSESS | details;
return DtStatus.DT_SUCCESS | details;
}

protected DtStatus AppendVertex(RcVec3f pos, int flags, long refs, ref List<DtStraightPath> straightPath,
Expand All @@ -1424,7 +1424,7 @@ protected DtStatus AppendVertex(RcVec3f pos, int flags, long refs, ref List<DtSt
// If reached end of path or there is no space to append more vertices, return.
if (flags == DtStraightPathFlags.DT_STRAIGHTPATH_END || straightPath.Count >= maxStraightPath)
{
return DtStatus.DT_SUCCSESS;
return DtStatus.DT_SUCCESS;
}
}

Expand Down Expand Up @@ -1736,7 +1736,7 @@ public virtual DtStatus FindStraightPath(RcVec3f startPos, RcVec3f endPos, List<

// Ignore status return value as we're just about to return anyway.
AppendVertex(closestEndPos, DtStraightPathFlags.DT_STRAIGHTPATH_END, 0, ref straightPath, maxStraightPath);
return DtStatus.DT_SUCCSESS | (straightPath.Count >= maxStraightPath ? DtStatus.DT_BUFFER_TOO_SMALL : DtStatus.DT_STATUS_NOTHING);
return DtStatus.DT_SUCCESS | (straightPath.Count >= maxStraightPath ? DtStatus.DT_BUFFER_TOO_SMALL : DtStatus.DT_STATUS_NOTHING);
}

/// @par
Expand Down Expand Up @@ -1942,7 +1942,7 @@ public DtStatus MoveAlongSurface(long startRef, RcVec3f startPos, RcVec3f endPos

resultPos = bestPos;

return DtStatus.DT_SUCCSESS;
return DtStatus.DT_SUCCESS;
}

protected DtStatus GetPortalPoints(long from, long to, out RcVec3f left, out RcVec3f right, out int fromType, out int toType)
Expand Down Expand Up @@ -2012,7 +2012,7 @@ protected DtStatus GetPortalPoints(long from, DtPoly fromPoly, DtMeshTile fromTi
right.Y = fromTile.data.verts[fromPoly.verts[v] * 3 + 1];
right.Z = fromTile.data.verts[fromPoly.verts[v] * 3 + 2];

return DtStatus.DT_SUCCSESS;
return DtStatus.DT_SUCCESS;
}
}

Expand All @@ -2034,7 +2034,7 @@ protected DtStatus GetPortalPoints(long from, DtPoly fromPoly, DtMeshTile fromTi
right.Y = toTile.data.verts[toPoly.verts[v] * 3 + 1];
right.Z = toTile.data.verts[toPoly.verts[v] * 3 + 2];

return DtStatus.DT_SUCCSESS;
return DtStatus.DT_SUCCESS;
}
}

Expand Down Expand Up @@ -2067,7 +2067,7 @@ protected DtStatus GetPortalPoints(long from, DtPoly fromPoly, DtMeshTile fromTi
}
}

return DtStatus.DT_SUCCSESS;
return DtStatus.DT_SUCCESS;
}

protected DtStatus GetEdgeMidPoint(long from, DtPoly fromPoly, DtMeshTile fromTile, long to,
Expand All @@ -2083,7 +2083,7 @@ protected DtStatus GetEdgeMidPoint(long from, DtPoly fromPoly, DtMeshTile fromTi
mid.Y = (left.Y + right.Y) * 0.5f;
mid.Z = (left.Z + right.Z) * 0.5f;

return DtStatus.DT_SUCCSESS;
return DtStatus.DT_SUCCESS;
}

protected DtStatus GetEdgeIntersectionPoint(RcVec3f fromPos, long from, DtPoly fromPoly, DtMeshTile fromTile,
Expand All @@ -2103,7 +2103,7 @@ protected DtStatus GetEdgeIntersectionPoint(RcVec3f fromPos, long from, DtPoly f
}

pt = RcVec3f.Lerp(left, right, t);
return DtStatus.DT_SUCCSESS;
return DtStatus.DT_SUCCESS;
}


Expand Down Expand Up @@ -2210,7 +2210,7 @@ public DtStatus Raycast(long startRef, RcVec3f startPos, RcVec3f endPos, IDtQuer
if (!intersects)
{
// Could not hit the polygon, keep the old t and report hit.
return DtStatus.DT_SUCCSESS;
return DtStatus.DT_SUCCESS;
}

hit.hitEdgeIndex = segMax;
Expand All @@ -2236,7 +2236,7 @@ public DtStatus Raycast(long startRef, RcVec3f startPos, RcVec3f endPos, IDtQuer
curRef, tile, poly);
}

return DtStatus.DT_SUCCSESS;
return DtStatus.DT_SUCCESS;
}

// Follow neighbours.
Expand Down Expand Up @@ -2364,7 +2364,7 @@ public DtStatus Raycast(long startRef, RcVec3f startPos, RcVec3f endPos, IDtQuer
float dx = verts[b].X - verts[a].X;
float dz = verts[b].Z - verts[a].X;
hit.hitNormal = RcVec3f.Normalize(new RcVec3f(dz, 0, -dx));
return DtStatus.DT_SUCCSESS;
return DtStatus.DT_SUCCESS;
}

// No hit, advance to neighbour polygon.
Expand All @@ -2376,7 +2376,7 @@ public DtStatus Raycast(long startRef, RcVec3f startPos, RcVec3f endPos, IDtQuer
poly = nextPoly;
}

return DtStatus.DT_SUCCSESS;
return DtStatus.DT_SUCCESS;
}

/// @par
Expand Down Expand Up @@ -2556,7 +2556,7 @@ public DtStatus FindPolysAroundCircle(long startRef, RcVec3f centerPos, float ra
}
}

return DtStatus.DT_SUCCSESS;
return DtStatus.DT_SUCCESS;
}

/// @par
Expand Down Expand Up @@ -2739,7 +2739,7 @@ public DtStatus FindPolysAroundShape(long startRef, RcVec3f[] verts, IDtQueryFil
}
}

return DtStatus.DT_SUCCSESS;
return DtStatus.DT_SUCCESS;
}

/// @par
Expand Down Expand Up @@ -2925,7 +2925,7 @@ public DtStatus FindLocalNeighbourhood(long startRef, RcVec3f centerPos, float r
}
}

return DtStatus.DT_SUCCSESS;
return DtStatus.DT_SUCCESS;
}


Expand Down Expand Up @@ -3077,7 +3077,7 @@ public DtStatus GetPolyWallSegments(long refs, bool storePortals, IDtQueryFilter
}
}

return DtStatus.DT_SUCCSESS;
return DtStatus.DT_SUCCESS;
}

/// @par
Expand Down Expand Up @@ -3133,7 +3133,7 @@ public virtual DtStatus FindDistanceToWall(long startRef, RcVec3f centerPos, flo
var bestvj = RcVec3f.Zero;
var bestvi = RcVec3f.Zero;

var status = DtStatus.DT_SUCCSESS;
var status = DtStatus.DT_SUCCESS;
while (!m_openList.IsEmpty())
{
DtNode bestNode = m_openList.Pop();
Expand Down Expand Up @@ -3393,7 +3393,7 @@ protected DtStatus GetPathToNode(DtNode endNode, ref List<long> path)
} while (curNode != null);

path.Reverse();
return DtStatus.DT_SUCCSESS;
return DtStatus.DT_SUCCESS;
}

/**
Expand Down
4 changes: 2 additions & 2 deletions src/DotRecast.Detour/DtStatus.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public readonly struct DtStatus
{
// High level status.
public static readonly DtStatus DT_FAILURE = new DtStatus(1u << 31); // Operation failed.
public static readonly DtStatus DT_SUCCSESS = new DtStatus(1u << 30); // Operation succeed.
public static readonly DtStatus DT_SUCCESS = new DtStatus(1u << 30); // Operation succeed.
public static readonly DtStatus DT_IN_PROGRESS = new DtStatus(1u << 29); // Operation still in progress.

// Detail information for status.
Expand Down Expand Up @@ -57,7 +57,7 @@ public bool IsEmpty()
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public bool Succeeded()
{
return 0 != (Value & (DT_SUCCSESS.Value | DT_PARTIAL_RESULT.Value));
return 0 != (Value & (DT_SUCCESS.Value | DT_PARTIAL_RESULT.Value));
}

[MethodImpl(MethodImplOptions.AggressiveInlining)]
Expand Down
8 changes: 4 additions & 4 deletions src/DotRecast.Recast.Toolset/Tools/RcTestNavMeshTool.cs
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ public DtStatus FindFollowPath(DtNavMesh navMesh, DtNavMeshQuery navQuery, long
}
}

return DtStatus.DT_SUCCSESS;
return DtStatus.DT_SUCCESS;
}

public DtStatus FindStraightPath(DtNavMeshQuery navQuery, long startRef, long endRef, RcVec3f startPt, RcVec3f endPt, IDtQueryFilter filter, bool enableRaycast,
Expand Down Expand Up @@ -196,7 +196,7 @@ public DtStatus FindStraightPath(DtNavMeshQuery navQuery, long startRef, long en

navQuery.FindStraightPath(startPt, epos, polys, ref straightPath, MAX_POLYS, straightPathOptions);

return DtStatus.DT_SUCCSESS;
return DtStatus.DT_SUCCESS;
}

public DtStatus InitSlicedFindPath(DtNavMeshQuery navQuery, long startRef, long endRef, RcVec3f startPos, RcVec3f endPos, IDtQueryFilter filter, bool enableRaycast)
Expand Down Expand Up @@ -242,7 +242,7 @@ public DtStatus UpdateSlicedFindPath(DtNavMeshQuery navQuery, int maxIter, long
navQuery.FindStraightPath(startPos, epos, path, ref straightPath, MAX_POLYS, DtStraightPathOptions.DT_STRAIGHTPATH_ALL_CROSSINGS);
}

return DtStatus.DT_SUCCSESS;
return DtStatus.DT_SUCCESS;
}


Expand Down Expand Up @@ -438,7 +438,7 @@ public DtStatus FindRandomPointAroundCircle(DtNavMeshQuery navQuery, long startR
}
}

return DtStatus.DT_SUCCSESS;
return DtStatus.DT_SUCCESS;
}
}
}
Loading
Loading