コード例 #1
0
ファイル: pathfinding.cpp プロジェクト: restarian/openmw
    bool PathFinder::checkWaypoint(float x, float y, float z)
    {
        if(mPath.empty())
            return true;

        ESM::Pathgrid::Point nextPoint = *mPath.begin();
        if(distanceZCorrected(nextPoint, x, y, z) < 64)
        {
            mPath.pop_front();
            if(mPath.empty()) mIsPathConstructed = false;
            return true;
        }
        return false;
    }
コード例 #2
0
ファイル: pathfinding.cpp プロジェクト: 4DA/openmw
 bool PathFinder::checkIfNextPointReached(float x,float y,float z)
 {
     if(mPath.empty())
     {
         return true;
     }
     ESM::Pathgrid::Point nextPoint = *mPath.begin();
     if(distanceZCorrected(nextPoint,x,y,z) < 20)
     {
         mPath.pop_front();
         if(mPath.empty())
         {
             return true;
         }
         nextPoint = *mPath.begin();
     }
     return false;
 }