+ const Vector<float> normCorrection = Norm(correction);
+ float faceCorrection = Dot(normCorrection, ctrl->Dir());
+
+ Face(normCorrection);
+ ctrl->linThrottle = faceCorrection * faceCorrection;
+}
+
+bool Autopilot::StandingStill() const {
+ return ctrl->vel.x * dt < std::numeric_limits<float>::epsilon()
+ && ctrl->vel.y * dt < std::numeric_limits<float>::epsilon();
+}
+
+bool Autopilot::ReallySlow() const {
+ return Speed() < ctrl->MaxFwdAcc() * dt;
+}
+
+bool Autopilot::FacingTarget() const {
+ return Facing(normDP);
+}
+
+bool Autopilot::FacingOpposite() const {
+ return Facing(-normDP);
+}
+
+bool Autopilot::Facing(Vector<float> v) const {
+ return std::abs(Dot(ctrl->Dir(), v) - 1)
+ < std::numeric_limits<float>::epsilon();
+}
+
+bool Autopilot::OnTarget() const {
+ return std::abs(Dot(Norm(ctrl->vel), Norm(*target - ctrl->pos)) - 1)
+ < std::numeric_limits<float>::epsilon();
+}
+
+
+float Autopilot::Speed() const {
+ return speed;
+}
+float Autopilot::Distance() const {
+ return dist;
+}