SGVec3d ecPos;
SGQuatf ecOrient;
+
if (tInterp <= curentPkgTime) {
// Ok, we need a time prevous to the last available packet,
// that is good ...
MotionInfo::iterator firstIt = mMotionInfo.begin();
ecPos = firstIt->second.position;
ecOrient = firstIt->second.orientation;
+ speed = norm(firstIt->second.linearVel) * SG_METER_TO_NM * 3600.0;
std::vector<FGFloatPropertyData>::const_iterator firstPropIt;
std::vector<FGFloatPropertyData>::const_iterator firstPropItEnd;
ecPos = ((1-tau)*prevIt->second.position + tau*nextIt->second.position);
ecOrient = interpolate((float)tau, prevIt->second.orientation,
nextIt->second.orientation);
+ speed = norm((1-tau)*prevIt->second.linearVel
+ + tau*nextIt->second.linearVel) * SG_METER_TO_NM * 3600.0;
if (prevIt->second.properties.size()
== nextIt->second.properties.size()) {
t -= h;
}
+ speed = norm(linearVel) * SG_METER_TO_NM * 3600.0;
+
std::vector<FGFloatPropertyData>::const_iterator firstPropIt;
std::vector<FGFloatPropertyData>::const_iterator firstPropItEnd;
firstPropIt = it->second.properties.begin();
}
// extract the position
- SGGeod geod = ecPos;
- pos.setlat(geod.getLatitudeDeg());
- pos.setlon(geod.getLongitudeDeg());
- pos.setelev(geod.getElevationM());
-
+ pos = SGGeod::fromCart(ecPos);
+ altitude_ft = pos.getElevationFt();
+
// The quaternion rotating from the earth centered frame to the
// horizontal local frame
- SGQuatf qEc2Hl = SGQuatf::fromLonLatRad((float)geod.getLongitudeRad(),
- (float)geod.getLatitudeRad());
+ SGQuatf qEc2Hl = SGQuatf::fromLonLatRad((float)pos.getLongitudeRad(),
+ (float)pos.getLatitudeRad());
// The orientation wrt the horizontal local frame
SGQuatf hlOr = conj(qEc2Hl)*ecOrient;
float hDeg, pDeg, rDeg;
pitch = pDeg;
SG_LOG(SG_GENERAL, SG_DEBUG, "Multiplayer position and orientation: "
- << geod << ", " << hlOr);
+ << ecPos << ", " << hlOr);
//###########################//
// do calculations for radar //