Beispiel #1
0
/*
 * Check existance of obstacles. The route is specified by 
 * source and destination. If targetBurdenLoc is given, it is
 * excluded from obstacles. If targetBurdenLoc==null, ignored.
 */
bool SampleBase::checkAllConflict(const Vec3d& src,const Vec3d& dest,const Vec3d& targetBurdenLoc) {
    vector<Vec3d> array = burdenSet.getVectors();
    for (vector<Vec3d>::iterator itr = array.begin(); itr != array.end(); itr++) {
        Vec3d v = (*itr);
        if (v == src)
            continue;
        if (v == dest)
            continue;
        if (targetBurdenLoc.x<1000 && v.epsilonEquals(targetBurdenLoc,1.0))
            continue;
        if (checkConflict(src,dest,v,1.5)) {
            return true;
        }
    }
    if (checkConflict(src,dest,obstacle1,3.0))
        return true;
    if (checkConflict(src,dest,obstacle2,3.0))
        return true;
    return false;
}