|| c.front().intersects_with(this->_front);
}
+void
+ParkingSlot::set_to_start(BicycleCar& c)
+{
+ c.h(this->h());
+ double clen = -this->_offset + this->len() - c.df();
+ double cw = c.w() / 2.0;
+ c.x(this->lrx() + clen * cos(c.h()) + cw * cos(c.h() + M_PI / 2.0));
+ c.y(this->lry() + clen * sin(c.h()) + cw * sin(c.h() + M_PI / 2.0));
+ c.set_max_steer();
+ assert(this->_parking_speed < 0.0);
+ c.sp(this->_parking_speed);
+}
+
std::vector<BicycleCar>
ParkingSlot::drive_in_slot(BicycleCar c)
{
this->swap_side();
swapped = true;
}
- c.h(this->h());
- double clen = -this->_offset + this->len() - c.df();
- double cw = c.w() / 2.0;
- c.x(this->lrx() + clen * cos(c.h()) + cw * cos(c.h() + M_PI / 2.0));
- c.y(this->lry() + clen * sin(c.h()) + cw * sin(c.h() + M_PI / 2.0));
- c.set_max_steer();
- assert(this->_parking_speed < 0.0);
- c.sp(this->_parking_speed);
+ this->set_to_start(c);
auto const rc = c.rf();
this->_curb.intersects_with(rc, c.len());
double max_to_slot;
return p;
}
+void
+ParkingSlot::gen_gnuplot_to(std::ostream& out)
+{
+ this->rear().gen_gnuplot_to(out);
+ this->curb().gen_gnuplot_to(out);
+ this->front().gen_gnuplot_to(out);
+}
+
std::ostream&
operator<<(std::ostream& o, ParkingSlot const& s)
{