parent
c208fd332c
commit
8f16b7de2f
@ -106,7 +106,6 @@ inline int longestAxis(unsigned short x, unsigned short y, unsigned short z)
|
|||||||
if (z > maxVal)
|
if (z > maxVal)
|
||||||
{
|
{
|
||||||
axis = 2;
|
axis = 2;
|
||||||
maxVal = z;
|
|
||||||
}
|
}
|
||||||
return axis;
|
return axis;
|
||||||
}
|
}
|
||||||
|
@ -1849,10 +1849,12 @@ dtStatus dtNavMeshQuery::findStraightPath(const float* startPos, const float* en
|
|||||||
for (int i = 0; i < pathSize; ++i)
|
for (int i = 0; i < pathSize; ++i)
|
||||||
{
|
{
|
||||||
float left[3], right[3];
|
float left[3], right[3];
|
||||||
unsigned char fromType, toType;
|
unsigned char toType;
|
||||||
|
|
||||||
if (i+1 < pathSize)
|
if (i+1 < pathSize)
|
||||||
{
|
{
|
||||||
|
unsigned char fromType; // fromType is ignored.
|
||||||
|
|
||||||
// Next portal.
|
// Next portal.
|
||||||
if (dtStatusFailed(getPortalPoints(path[i], path[i+1], left, right, fromType, toType)))
|
if (dtStatusFailed(getPortalPoints(path[i], path[i+1], left, right, fromType, toType)))
|
||||||
{
|
{
|
||||||
@ -1894,7 +1896,7 @@ dtStatus dtNavMeshQuery::findStraightPath(const float* startPos, const float* en
|
|||||||
dtVcopy(left, closestEndPos);
|
dtVcopy(left, closestEndPos);
|
||||||
dtVcopy(right, closestEndPos);
|
dtVcopy(right, closestEndPos);
|
||||||
|
|
||||||
fromType = toType = DT_POLYTYPE_GROUND;
|
toType = DT_POLYTYPE_GROUND;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Right vertex.
|
// Right vertex.
|
||||||
@ -2482,10 +2484,10 @@ dtStatus dtNavMeshQuery::raycast(dtPolyRef startRef, const float* startPos, cons
|
|||||||
|
|
||||||
const dtMeshTile* prevTile, *tile, *nextTile;
|
const dtMeshTile* prevTile, *tile, *nextTile;
|
||||||
const dtPoly* prevPoly, *poly, *nextPoly;
|
const dtPoly* prevPoly, *poly, *nextPoly;
|
||||||
dtPolyRef curRef, nextRef;
|
dtPolyRef curRef;
|
||||||
|
|
||||||
// The API input has been checked already, skip checking internal data.
|
// The API input has been checked already, skip checking internal data.
|
||||||
nextRef = curRef = startRef;
|
curRef = startRef;
|
||||||
tile = 0;
|
tile = 0;
|
||||||
poly = 0;
|
poly = 0;
|
||||||
m_nav->getTileAndPolyByRefUnsafe(curRef, &tile, &poly);
|
m_nav->getTileAndPolyByRefUnsafe(curRef, &tile, &poly);
|
||||||
@ -2540,7 +2542,7 @@ dtStatus dtNavMeshQuery::raycast(dtPolyRef startRef, const float* startPos, cons
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Follow neighbours.
|
// Follow neighbours.
|
||||||
nextRef = 0;
|
dtPolyRef nextRef = 0;
|
||||||
|
|
||||||
for (unsigned int i = poly->firstLink; i != DT_NULL_LINK; i = tile->links[i].next)
|
for (unsigned int i = poly->firstLink; i != DT_NULL_LINK; i = tile->links[i].next)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user