bool collide(RRTEdge *e);
bool collide(std::vector<RRTEdge *> &edges);
float dist_to(RRTNode *n);
+ std::vector<RRTEdge *> frame();
// getter
std::vector<RRTNode *> &bnodes();
return 0;
}
+std::vector<RRTEdge *> PolygonObstacle::frame()
+{
+ std::vector<RRTEdge *> frame;
+ unsigned int i;
+ int j;
+ for (i = 1, j = 0; i < this->bnodes_.size(); j = i++) {
+ frame.push_back(new RRTEdge(
+ new RRTNode(
+ this->bnodes_[j]->x(),
+ this->bnodes_[j]->y(),
+ this->bnodes_[j]->h()
+ ),
+ new RRTNode(
+ this->bnodes_[i]->x(),
+ this->bnodes_[i]->y(),
+ this->bnodes_[i]->h()
+ )
+ ));
+ }
+ return frame;
+}
+
std::vector<RRTNode *> &PolygonObstacle::bnodes()
{
return this->bnodes_;