Skip to content

Commit

Permalink
Typo fixes (recastnavigation#660)
Browse files Browse the repository at this point in the history
* multiple comments typo fixes

* typo

* typos

* typos

* typos

---------

Co-authored-by: Alon Faraj <[email protected]>
  • Loading branch information
alonfaraj and Alon Faraj authored Aug 16, 2023
1 parent 6d9998e commit 1adf911
Show file tree
Hide file tree
Showing 18 changed files with 43 additions and 43 deletions.
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ If you have questions about how to use Recast or Detour, please direct these to
discussion list. We are also available on [Gitter][gitter].

## Have a question?
Questions about how to best use Recast, what it's capable of, and other inqueries should be directed to the [Q&A section of Github Discussions][q-and-a]. Questions submitted as Github issues will be converted to discussions.
Questions about how to best use Recast, what it's capable of, and other inquiries should be directed to the [Q&A section of Github Discussions][q-and-a]. Questions submitted as Github issues will be converted to discussions.

## Found an Issue?
If you find a bug in the source code or a mistake in the documentation, you can help us by
Expand Down Expand Up @@ -49,7 +49,7 @@ chances of your issue being dealt with quickly:
Implement `duDebugDraw` and call some methods from DetourDebugDraw.h. Seriously, just do it, we'll definitely ask you to if you haven't!
* **Logs** - stdout and stderr from the console, or log files if there are any.
If integrating into your own codebase, be sure to implement the log callbacks in `rcContext`.
* **Reproduction steps** - a minimal, unambigious set of steps including input, that causes the error for you.
* **Reproduction steps** - a minimal, unambiguous set of steps including input, that causes the error for you.
e.g. input geometry and settings you can use to input into RecastDemo to get it to fail.
Note: These can be saved by pressing the 9 key in RecastDemo, and the resulting .gset file can be shared (with the .obj if it is not one of the default ones).
* **Recast version(s) and/or git commit hash** - particularly if you can find the point at which the error first started happening
Expand Down
2 changes: 1 addition & 1 deletion Detour/Include/DetourNavMeshBuilder.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ struct dtNavMeshCreateParams

unsigned int userId; ///< The user defined id of the tile.
int tileX; ///< The tile's x-grid location within the multi-tile destination mesh. (Along the x-axis.)
int tileY; ///< The tile's y-grid location within the multi-tile desitation mesh. (Along the z-axis.)
int tileY; ///< The tile's y-grid location within the multi-tile destination mesh. (Along the z-axis.)
int tileLayer; ///< The tile's layer within the layered destination mesh. [Limit: >= 0] (Along the y-axis.)
float bmin[3]; ///< The minimum bounds of the tile. [(x, y, z)] [Unit: wu]
float bmax[3]; ///< The maximum bounds of the tile. [(x, y, z)] [Unit: wu]
Expand Down
8 changes: 4 additions & 4 deletions Detour/Include/DetourNavMeshQuery.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class dtQueryFilter
{
float m_areaCost[DT_MAX_AREAS]; ///< Cost per area type. (Used by default implementation.)
unsigned short m_includeFlags; ///< Flags for polygons that can be visited. (Used by default implementation.)
unsigned short m_excludeFlags; ///< Flags for polygons that should not be visted. (Used by default implementation.)
unsigned short m_excludeFlags; ///< Flags for polygons that should not be visited. (Used by default implementation.)

public:
dtQueryFilter();
Expand Down Expand Up @@ -178,7 +178,7 @@ class dtNavMeshQuery
/// @{

/// Finds a path from the start polygon to the end polygon.
/// @param[in] startRef The refrence id of the start polygon.
/// @param[in] startRef The reference id of the start polygon.
/// @param[in] endRef The reference id of the end polygon.
/// @param[in] startPos A position within the start polygon. [(x, y, z)]
/// @param[in] endPos A position within the end polygon. [(x, y, z)]
Expand Down Expand Up @@ -217,8 +217,8 @@ class dtNavMeshQuery
/// -# Call finalizeSlicedFindPath() to get the path.
///@{

/// Intializes a sliced path query.
/// @param[in] startRef The refrence id of the start polygon.
/// Initializes a sliced path query.
/// @param[in] startRef The reference id of the start polygon.
/// @param[in] endRef The reference id of the end polygon.
/// @param[in] startPos A position within the start polygon. [(x, y, z)]
/// @param[in] endPos A position within the end polygon. [(x, y, z)]
Expand Down
2 changes: 1 addition & 1 deletion Detour/Source/DetourNavMeshBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ bool dtCreateNavMeshData(dtNavMeshCreateParams* params, unsigned char** outData,
}
}

// Off-mesh connectionss are stored as polygons, adjust values.
// Off-mesh connections are stored as polygons, adjust values.
const int totPolyCount = params->polyCount + storedOffMeshConCount;
const int totVertCount = params->vertCount + storedOffMeshConCount*2;

Expand Down
26 changes: 13 additions & 13 deletions Detour/Source/DetourNavMeshQuery.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ dtStatus dtNavMeshQuery::findRandomPoint(const dtQueryFilter* filter, float (*fr
const dtMeshTile* t = m_nav->getTile(i);
if (!t || !t->header) continue;

// Choose random tile using reservoi sampling.
// Choose random tile using reservoir sampling.
const float area = 1.0f; // Could be tile area too.
tsum += area;
const float u = frand();
Expand Down Expand Up @@ -276,7 +276,7 @@ dtStatus dtNavMeshQuery::findRandomPoint(const dtQueryFilter* filter, float (*fr
polyArea += dtTriArea2D(va,vb,vc);
}

// Choose random polygon weighted by area, using reservoi sampling.
// Choose random polygon weighted by area, using reservoir sampling.
areaSum += polyArea;
const float u = frand();
if (u*areaSum <= polyArea)
Expand Down Expand Up @@ -365,7 +365,7 @@ dtStatus dtNavMeshQuery::findRandomPointAroundCircle(dtPolyRef startRef, const f
bestNode->flags |= DT_NODE_CLOSED;

// Get poly and tile.
// The API input has been cheked already, skip checking internal data.
// The API input has been checked already, skip checking internal data.
const dtPolyRef bestRef = bestNode->id;
const dtMeshTile* bestTile = 0;
const dtPoly* bestPoly = 0;
Expand All @@ -383,7 +383,7 @@ dtStatus dtNavMeshQuery::findRandomPointAroundCircle(dtPolyRef startRef, const f
const float* vc = &bestTile->verts[bestPoly->verts[j]*3];
polyArea += dtTriArea2D(va,vb,vc);
}
// Choose random polygon weighted by area, using reservoi sampling.
// Choose random polygon weighted by area, using reservoir sampling.
areaSum += polyArea;
const float u = frand();
if (u*areaSum <= polyArea)
Expand Down Expand Up @@ -1032,7 +1032,7 @@ dtStatus dtNavMeshQuery::findPath(dtPolyRef startRef, dtPolyRef endRef,
}

// Get current poly and tile.
// The API input has been cheked already, skip checking internal data.
// The API input has been checked already, skip checking internal data.
const dtPolyRef bestRef = bestNode->id;
const dtMeshTile* bestTile = 0;
const dtPoly* bestPoly = 0;
Expand All @@ -1056,7 +1056,7 @@ dtStatus dtNavMeshQuery::findPath(dtPolyRef startRef, dtPolyRef endRef,
continue;

// Get neighbour poly and tile.
// The API input has been cheked already, skip checking internal data.
// The API input has been checked already, skip checking internal data.
const dtMeshTile* neighbourTile = 0;
const dtPoly* neighbourPoly = 0;
m_nav->getTileAndPolyByRefUnsafe(neighbourRef, &neighbourTile, &neighbourPoly);
Expand Down Expand Up @@ -1314,7 +1314,7 @@ dtStatus dtNavMeshQuery::updateSlicedFindPath(const int maxIter, int* doneIters)
}

// Get current poly and tile.
// The API input has been cheked already, skip checking internal data.
// The API input has been checked already, skip checking internal data.
const dtPolyRef bestRef = bestNode->id;
const dtMeshTile* bestTile = 0;
const dtPoly* bestPoly = 0;
Expand Down Expand Up @@ -1369,7 +1369,7 @@ dtStatus dtNavMeshQuery::updateSlicedFindPath(const int maxIter, int* doneIters)
continue;

// Get neighbour poly and tile.
// The API input has been cheked already, skip checking internal data.
// The API input has been checked already, skip checking internal data.
const dtMeshTile* neighbourTile = 0;
const dtPoly* neighbourPoly = 0;
m_nav->getTileAndPolyByRefUnsafe(neighbourRef, &neighbourTile, &neighbourPoly);
Expand Down Expand Up @@ -2099,7 +2099,7 @@ dtStatus dtNavMeshQuery::moveAlongSurface(dtPolyRef startRef, const float* start
nstack--;

// Get poly and tile.
// The API input has been cheked already, skip checking internal data.
// The API input has been checked already, skip checking internal data.
const dtPolyRef curRef = curNode->id;
const dtMeshTile* curTile = 0;
const dtPoly* curPoly = 0;
Expand Down Expand Up @@ -2764,7 +2764,7 @@ dtStatus dtNavMeshQuery::findPolysAroundCircle(dtPolyRef startRef, const float*
bestNode->flags |= DT_NODE_CLOSED;

// Get poly and tile.
// The API input has been cheked already, skip checking internal data.
// The API input has been checked already, skip checking internal data.
const dtPolyRef bestRef = bestNode->id;
const dtMeshTile* bestTile = 0;
const dtPoly* bestPoly = 0;
Expand Down Expand Up @@ -2944,7 +2944,7 @@ dtStatus dtNavMeshQuery::findPolysAroundShape(dtPolyRef startRef, const float* v
bestNode->flags |= DT_NODE_CLOSED;

// Get poly and tile.
// The API input has been cheked already, skip checking internal data.
// The API input has been checked already, skip checking internal data.
const dtPolyRef bestRef = bestNode->id;
const dtMeshTile* bestTile = 0;
const dtPoly* bestPoly = 0;
Expand Down Expand Up @@ -3151,7 +3151,7 @@ dtStatus dtNavMeshQuery::findLocalNeighbourhood(dtPolyRef startRef, const float*
nstack--;

// Get poly and tile.
// The API input has been cheked already, skip checking internal data.
// The API input has been checked already, skip checking internal data.
const dtPolyRef curRef = curNode->id;
const dtMeshTile* curTile = 0;
const dtPoly* curPoly = 0;
Expand Down Expand Up @@ -3507,7 +3507,7 @@ dtStatus dtNavMeshQuery::findDistanceToWall(dtPolyRef startRef, const float* cen
bestNode->flags |= DT_NODE_CLOSED;

// Get poly and tile.
// The API input has been cheked already, skip checking internal data.
// The API input has been checked already, skip checking internal data.
const dtPolyRef bestRef = bestNode->id;
const dtMeshTile* bestTile = 0;
const dtPoly* bestPoly = 0;
Expand Down
4 changes: 2 additions & 2 deletions DetourCrowd/Include/DetourCrowd.h
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ class dtCrowd

/// Adds a new agent to the crowd.
/// @param[in] pos The requested position of the agent. [(x, y, z)]
/// @param[in] params The configutation of the agent.
/// @param[in] params The configuration of the agent.
/// @return The index of the agent in the agent pool. Or -1 if the agent could not be added.
int addAgent(const float* pos, const dtCrowdAgentParams* params);

Expand Down Expand Up @@ -444,7 +444,7 @@ This value is often based on the agent radius and/or maximum speed. E.g. radius
@var dtCrowdAgentParams::pathOptimizationRange
@par
Only applicalbe if #updateFlags includes the #DT_CROWD_OPTIMIZE_VIS flag.
Only applicable if #updateFlags includes the #DT_CROWD_OPTIMIZE_VIS flag.
This value is often based on the agent radius. E.g. radius * 30
Expand Down
2 changes: 1 addition & 1 deletion DetourCrowd/Source/DetourObstacleAvoidance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ float dtObstacleAvoidanceQuery::processSample(const float* vcand, const float cs
const float vcpen = m_params.weightCurVel * (dtVdist2D(vcand, vel) * m_invVmax);

// find the threshold hit time to bail out based on the early out penalty
// (see how the penalty is calculated below to understnad)
// (see how the penalty is calculated below to understand)
float minPen = minPenalty - vpen - vcpen;
float tThresold = (m_params.weightToi / minPen - 0.1f) * m_params.horizTime;
if (tThresold - m_params.horizTime > -FLT_EPSILON)
Expand Down
2 changes: 1 addition & 1 deletion DetourTileCache/Include/DetourTileCacheBuilder.h
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ dtStatus dtBuildTileCachePolyMesh(dtTileCacheAlloc* alloc,
dtTileCachePolyMesh& mesh);

/// Swaps the endianess of the compressed tile data's header (#dtTileCacheLayerHeader).
/// Tile layer data does not need endian swapping as it consits only of bytes.
/// Tile layer data does not need endian swapping as it consist only of bytes.
/// @param[in,out] data The tile data array.
/// @param[in] dataSize The size of the data array.
bool dtTileCacheHeaderSwapEndian(unsigned char* data, const int dataSize);
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Recast constructs a navmesh through a multi-step rasterization process:
1. First Recast voxelizes the input triangle mesh by rasterizing the triangles into a multi-layer heightfield.
2. Voxels in areas where the character would not be able to move are removed by applying simple voxel data filters.
3. The walkable areas described by the voxel grid are then divided into sets of 2D polygonal regions.
4. The navigation polygons are generated by triangulating and stiching together the generated 2d plygonal regions.
4. The navigation polygons are generated by triangulating and stiching together the generated 2d polygonal regions.

## Detour

Expand Down
2 changes: 1 addition & 1 deletion Recast/Include/Recast.h
Original file line number Diff line number Diff line change
Expand Up @@ -1003,7 +1003,7 @@ bool rcRasterizeTriangles(rcContext* context,
/// Allows the formation of walkable regions that will flow over low lying
/// objects such as curbs, and up structures such as stairways.
///
/// Two neighboring spans are walkable if: <tt>rcAbs(currentSpan.smax - neighborSpan.smax) < waklableClimb</tt>
/// Two neighboring spans are walkable if: <tt>rcAbs(currentSpan.smax - neighborSpan.smax) < walkableClimb</tt>
///
/// @warning Will override the effect of #rcFilterLedgeSpans. So if both filters are used, call
/// #rcFilterLedgeSpans after calling this filter.
Expand Down
2 changes: 1 addition & 1 deletion Recast/Include/RecastAlloc.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ struct rcNewTag {};
inline void* operator new(size_t, const rcNewTag&, void* p) { return p; }
inline void operator delete(void*, const rcNewTag&, void*) {}

/// Signed to avoid warnnings when comparing to int loop indexes, and common error with comparing to zero.
/// Signed to avoid warnings when comparing to int loop indexes, and common error with comparing to zero.
/// MSVC2010 has a bug where ssize_t is unsigned (!!!).
typedef intptr_t rcSizeType;
#define RC_SIZE_MAX INTPTR_MAX
Expand Down
6 changes: 3 additions & 3 deletions Recast/Source/RecastContour.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ static void simplifyContour(rcIntArray& points, rcIntArray& simplified,
if (dx*dx + dz*dz > maxEdgeLen*maxEdgeLen)
{
// Round based on the segments in lexilogical order so that the
// max tesselation is consistent regardles in which direction
// max tesselation is consistent regardless in which direction
// segments are traversed.
const int n = bi < ai ? (bi+pn - ai) : (bi - ai);
if (n > 1)
Expand Down Expand Up @@ -512,7 +512,7 @@ static bool intersectProp(const int* a, const int* b, const int* c, const int* d
}

// Returns T iff (a,b,c) are collinear and point c lies
// on the closed segement ab.
// on the closed segment ab.
static bool between(const int* a, const int* b, const int* c)
{
if (!collinear(a, b, c))
Expand Down Expand Up @@ -749,7 +749,7 @@ static void mergeRegionHoles(rcContext* ctx, rcContourRegion& region)
for (int iter = 0; iter < hole->nverts; iter++)
{
// Find potential diagonals.
// The 'best' vertex must be in the cone described by 3 cosequtive vertices of the outline.
// The 'best' vertex must be in the cone described by 3 consecutive vertices of the outline.
// ..o j-1
// |
// | * best
Expand Down
2 changes: 1 addition & 1 deletion Recast/Source/RecastMesh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -983,7 +983,7 @@ static bool removeVertex(rcContext* ctx, rcPolyMesh& mesh, const unsigned short
/// @par
///
/// @note If the mesh data is to be used to construct a Detour navigation mesh, then the upper
/// limit must be retricted to <= #DT_VERTS_PER_POLYGON.
/// limit must be restricted to <= #DT_VERTS_PER_POLYGON.
///
/// @see rcAllocPolyMesh, rcContourSet, rcPolyMesh, rcConfig
bool rcBuildPolyMesh(rcContext* ctx, const rcContourSet& cset, const int nvp, rcPolyMesh& mesh)
Expand Down
4 changes: 2 additions & 2 deletions Recast/Source/RecastMeshDetail.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -589,8 +589,8 @@ static void triangulateHull(const int /*nverts*/, const float* verts, const int

// Triangulate the polygon by moving left or right,
// depending on which triangle has shorter perimeter.
// This heuristic was chose emprically, since it seems
// handle tesselated straight edges well.
// This heuristic was chose empirically, since it seems
// handle tessellated straight edges well.
while (next(left, nhull) != right)
{
// Check to see if se should advance left or right.
Expand Down
6 changes: 3 additions & 3 deletions Recast/Source/RecastRegion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1339,7 +1339,7 @@ struct rcSweepSpan
/// re-assigned to the zero (null) region.
///
/// Partitioning can result in smaller than necessary regions. @p mergeRegionArea helps
/// reduce unecessarily small regions.
/// reduce unnecessarily small regions.
///
/// See the #rcConfig documentation for more information on the configuration parameters.
///
Expand Down Expand Up @@ -1512,7 +1512,7 @@ bool rcBuildRegionsMonotone(rcContext* ctx, rcCompactHeightfield& chf,
/// re-assigned to the zero (null) region.
///
/// Watershed partitioning can result in smaller than necessary regions, especially in diagonal corridors.
/// @p mergeRegionArea helps reduce unecessarily small regions.
/// @p mergeRegionArea helps reduce unnecessarily small regions.
///
/// See the #rcConfig documentation for more information on the configuration parameters.
///
Expand Down Expand Up @@ -1637,7 +1637,7 @@ bool rcBuildRegions(rcContext* ctx, rcCompactHeightfield& chf,
{
rcScopedTimer timerFilter(ctx, RC_TIMER_BUILD_REGIONS_FILTER);

// Merge regions and filter out smalle regions.
// Merge regions and filter out small regions.
rcIntArray overlaps;
chf.maxRegions = regionId;
if (!mergeAndFilterRegions(ctx, minRegionArea, mergeRegionArea, chf.maxRegions, chf, srcReg, overlaps))
Expand Down
2 changes: 1 addition & 1 deletion RecastDemo/Source/NavMeshPruneTool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ static void floodNavmesh(dtNavMesh* nav, NavmeshFlags* flags, dtPolyRef start, u
openList.pop_back();

// Get current poly and tile.
// The API input has been cheked already, skip checking internal data.
// The API input has been checked already, skip checking internal data.
const dtMeshTile* tile = 0;
const dtPoly* poly = 0;
nav->getTileAndPolyByRefUnsafe(ref, &tile, &poly);
Expand Down
6 changes: 3 additions & 3 deletions RecastDemo/Source/Sample_SoloMesh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,7 @@ bool Sample_SoloMesh::handleBuild()


// Partition the heightfield so that we can use simple algorithm later to triangulate the walkable areas.
// There are 3 martitioning methods, each with some pros and cons:
// There are 3 partitioning methods, each with some pros and cons:
// 1) Watershed partitioning
// - the classic Recast partitioning
// - creates the nicest tessellation
Expand All @@ -528,8 +528,8 @@ bool Sample_SoloMesh::handleBuild()
// - the are some corner cases where this method creates produces holes and overlaps
// - holes may appear when a small obstacles is close to large open area (triangulation can handle this)
// - overlaps may occur if you have narrow spiral corridors (i.e stairs), this make triangulation to fail
// * generally the best choice if you precompute the nacmesh, use this if you have large open areas
// 2) Monotone partioning
// * generally the best choice if you precompute the navmesh, use this if you have large open areas
// 2) Monotone partitioning
// - fastest
// - partitions the heightfield into regions without holes and overlaps (guaranteed)
// - creates long thin polygons, which sometimes causes paths with detours
Expand Down
4 changes: 2 additions & 2 deletions Tests/Recast/Tests_Recast.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1061,7 +1061,7 @@ TEST_CASE("rcVector")
vec.resize(100);
Incrementor::Reset();
vec.clear();
// One temp object is constructed for the default argumnet of resize().
// One temp object is constructed for the default argument of resize().
REQUIRE(Incrementor::constructions == 0);
REQUIRE(Incrementor::destructions == 100);
REQUIRE(Incrementor::copies == 0);
Expand All @@ -1076,7 +1076,7 @@ TEST_CASE("rcVector")
SECTION("Copying Contents")
{

// veriyf event counts after doubling size -- should require a lot of copying and destorying.
// veriyf event counts after doubling size -- should require a lot of copying and destroying.
rcTempVector<Incrementor> vec;
Incrementor::Reset();
vec.resize(100);
Expand Down

0 comments on commit 1adf911

Please sign in to comment.