本文整理汇总了C++中GlideResult::IsAchievable方法的典型用法代码示例。如果您正苦于以下问题:C++ GlideResult::IsAchievable方法的具体用法?C++ GlideResult::IsAchievable怎么用?C++ GlideResult::IsAchievable使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GlideResult
的用法示例。
在下文中一共展示了GlideResult::IsAchievable方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
gcc_pure
static bool
IsReachable(const GlideResult &result, bool final_glide)
{
return final_glide
? result.IsFinalGlide()
: result.IsAchievable();
}
示例2:
static void
SetValueFromAltDiff(InfoBoxData &data, const TaskStats &task_stats,
const GlideResult &solution)
{
if (!task_stats.task_valid || !solution.IsAchievable()) {
data.SetInvalid();
return;
}
const ComputerSettings &settings = CommonInterface::GetComputerSettings();
fixed altitude_difference =
solution.SelectAltitudeDifference(settings.task.glide);
data.SetValueFromArrival(altitude_difference);
}
示例3:
void
InfoBoxContentNextAltitudeArrival::Update(InfoBoxData &data)
{
// pilots want this to be assuming terminal flight to this wp
const MoreData &basic = CommonInterface::Basic();
const TaskStats &task_stats = XCSoarInterface::Calculated().task_stats;
const GlideResult next_solution = XCSoarInterface::Calculated().common_stats.next_solution;
if (!task_stats.task_valid || !next_solution.IsAchievable()) {
data.SetInvalid();
return;
}
data.SetValueFromAltitude(next_solution.GetArrivalAltitude(basic.nav_altitude));
}
示例4: AirspaceAircraftPerformance
/**
* Specialisation of AirspaceAircraftPerformance for tasks where
* part of the path is in cruise, part in final glide. This is
* intended to be used temporarily only.
*
* This simplifies the path by assuming flight is constant altitude
* or descent to the task point elevation.
*/
AirspaceAircraftPerformance(const GlidePolar &polar,
const GlideResult &solution)
:vertical_tolerance(0.001),
cruise_speed(positive(solution.time_elapsed)
? solution.vector.distance / solution.time_elapsed
: fixed(1)),
cruise_descent(positive(solution.time_elapsed)
? (positive(solution.height_climb)
? -solution.height_climb
: solution.height_glide) / solution.time_elapsed
: fixed(0)),
descent_rate(polar.GetSBestLD()),
climb_rate(positive(solution.time_elapsed) &&
positive(solution.height_climb)
? polar.GetMC()
: fixed(0)),
max_speed(cruise_speed) {
assert(polar.IsValid());
assert(solution.IsOk());
assert(solution.IsAchievable());
}
示例5: IsAchievable
/**
* Determine whether the task (or subtask) is able to be finished
* (will fail if MC too low, wind too high etc)
*
* @return True if can finish the task
*/
bool IsAchievable() const {
return solution_remaining.IsAchievable();
}