- waypoint *wpt;
-
- // Get the current active runway, based on code from David Luff
- // This should actually be unified and extended to include
- // Preferential runway use schema's
- if (firstFlight)
- {
- string rwyClass = getRunwayClassFromTrafficType(fltType);
- apt->getDynamics()->getActiveRunway(rwyClass, 1, activeRunway);
- rwy = apt->getRunwayByIdent(activeRunway);
- }
-
- double airportElev = apt->getElevation();
- // Acceleration point, 105 meters into the runway,
- SGGeod accelPoint = rwy->pointOnCenterline(105.0);
- wpt = createOnGround("accel", accelPoint, airportElev, speed);
- waypoints.push_back(wpt);
+ double accel = ac->getPerformance()->acceleration();
+ double vRotate = ac->getPerformance()->vRotate();
+ // Acceleration = dV / dT
+ // Acceleration X dT = dV
+ // dT = dT / Acceleration
+ //d = (Vf^2 - Vo^2) / (2*a)
+ double accelTime = (vRotate - 15) / accel;
+ //cerr << "Using " << accelTime << " as total acceleration time" << endl;
+ double accelDistance = (vRotate*vRotate - 15*15) / (2*accel);
+ //cerr << "Using " << accelDistance << " " << accel << " " << vRotate << endl;
+ waypoint *wpt;
+ // Get the current active runway, based on code from David Luff
+ // This should actually be unified and extended to include
+ // Preferential runway use schema's
+ // NOTE: DT (2009-01-18: IIRC, this is currently already the case,
+ // because the getActive runway function takes care of that.
+ if (firstFlight)
+ {
+ string rwyClass = getRunwayClassFromTrafficType(fltType);
+ double heading = ac->getTrafficRef()->getCourse();
+ apt->getDynamics()->getActiveRunway(rwyClass, 1, activeRunway, heading);
+ rwy = apt->getRunwayByIdent(activeRunway);
+ }
+
+ double airportElev = apt->getElevation();
+ // Acceleration point, 105 meters into the runway,
+ SGGeod accelPoint = rwy->pointOnCenterline(105.0);
+ wpt = createOnGround(ac, "accel", accelPoint, airportElev, speed);
+ waypoints.push_back(wpt);