int JSBSimModel::getEngThrust(LCreal* const fn, const int max) const { if (fdmex == 0) return 0; JSBSim::FGPropulsion* Propulsion = fdmex->GetPropulsion(); if (Propulsion == 0) return 0; if (fn == 0 || max <= 0) { return 0; } int num = getNumberOfEngines(); if (max < num) { num = max; } for (int i = 0; i < num; i++) { JSBSim::FGThruster* thruster = Propulsion->GetEngine(i)->GetThruster(); fn[i] = (LCreal)thruster->GetThrust(); } return num; }
int JSBSimModel::getEngThrust(double* const fn, const int max) const { if (fdmex == nullptr) return 0; JSBSim::FGPropulsion* Propulsion = fdmex->GetPropulsion(); if (Propulsion == nullptr) return 0; if (fn == nullptr || max <= 0) { return 0; } int num = getNumberOfEngines(); if (max < num) { num = max; } for (int i = 0; i < num; i++) { JSBSim::FGThruster* thruster = Propulsion->GetEngine(i)->GetThruster(); fn[i] = static_cast<double>(thruster->GetThrust()); } return num; }