|
|
|
@ -114,8 +114,7 @@ namespace MWMechanics
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
PathFinder::PathFinder()
|
|
|
|
|
: mIsPathConstructed(false),
|
|
|
|
|
mPathgrid(NULL),
|
|
|
|
|
: mPathgrid(NULL),
|
|
|
|
|
mCell(NULL)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
@ -124,7 +123,6 @@ namespace MWMechanics
|
|
|
|
|
{
|
|
|
|
|
if(!mPath.empty())
|
|
|
|
|
mPath.clear();
|
|
|
|
|
mIsPathConstructed = false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
@ -180,7 +178,6 @@ namespace MWMechanics
|
|
|
|
|
static_cast<float>(endPoint.mX), static_cast<float>(endPoint.mY), static_cast<float>(endPoint.mZ)))
|
|
|
|
|
{
|
|
|
|
|
mPath.push_back(endPoint);
|
|
|
|
|
mIsPathConstructed = true;
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -197,7 +194,6 @@ namespace MWMechanics
|
|
|
|
|
if(!mPathgrid || mPathgrid->mPoints.empty())
|
|
|
|
|
{
|
|
|
|
|
mPath.push_back(endPoint);
|
|
|
|
|
mIsPathConstructed = true;
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -235,7 +231,6 @@ namespace MWMechanics
|
|
|
|
|
if(startNode == endNode.first)
|
|
|
|
|
{
|
|
|
|
|
mPath.push_back(endPoint);
|
|
|
|
|
mIsPathConstructed = true;
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -243,7 +238,6 @@ namespace MWMechanics
|
|
|
|
|
|
|
|
|
|
if(!mPath.empty())
|
|
|
|
|
{
|
|
|
|
|
mIsPathConstructed = true;
|
|
|
|
|
// Add the destination (which may be different to the closest
|
|
|
|
|
// pathgrid point). However only add if endNode was the closest
|
|
|
|
|
// point to endPoint.
|
|
|
|
@ -256,14 +250,8 @@ namespace MWMechanics
|
|
|
|
|
if(endNode.second)
|
|
|
|
|
mPath.push_back(endPoint);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
mIsPathConstructed = false;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
mIsPathConstructed = false;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
mIsPathConstructed = false;
|
|
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
@ -271,7 +259,7 @@ namespace MWMechanics
|
|
|
|
|
float PathFinder::getZAngleToNext(float x, float y) const
|
|
|
|
|
{
|
|
|
|
|
// This should never happen (programmers should have an if statement checking
|
|
|
|
|
// mIsPathConstructed that prevents this call if otherwise).
|
|
|
|
|
// isPathConstructed that prevents this call if otherwise).
|
|
|
|
|
if(mPath.empty())
|
|
|
|
|
return 0.;
|
|
|
|
|
|
|
|
|
@ -293,7 +281,6 @@ namespace MWMechanics
|
|
|
|
|
mPath.pop_front();
|
|
|
|
|
if(mPath.empty())
|
|
|
|
|
{
|
|
|
|
|
mIsPathConstructed = false;
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|