本文整理汇总了C++中Waypoints::GetNearestLandable方法的典型用法代码示例。如果您正苦于以下问题:C++ Waypoints::GetNearestLandable方法的具体用法?C++ Waypoints::GetNearestLandable怎么用?C++ Waypoints::GetNearestLandable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Waypoints
的用法示例。
在下文中一共展示了Waypoints::GetNearestLandable方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GeoVector
static void
TestGetNearest(const Waypoints &waypoints, const GeoPoint ¢er)
{
WaypointPtr waypoint;
GeoPoint near = GeoVector(fixed(250), Angle::Degrees(15)).EndPoint(center);
GeoPoint far = GeoVector(fixed(750), Angle::Degrees(15)).EndPoint(center);
GeoPoint further = GeoVector(fixed(4200), Angle::Degrees(48)).EndPoint(center);
ok1((waypoint = waypoints.GetNearest(center, fixed(1))) != NULL);
ok1(waypoint->original_id == 0);
ok1((waypoint = waypoints.GetNearest(center, fixed(10000))) != NULL);
ok1(waypoint->original_id == 0);
ok1((waypoint = waypoints.GetNearest(near, fixed(1))) == NULL);
ok1((waypoint = waypoints.GetNearest(near, fixed(10000))) != NULL);
ok1(waypoint->original_id == 0);
ok1((waypoint = waypoints.GetNearest(far, fixed(1))) == NULL);
ok1((waypoint = waypoints.GetNearest(far, fixed(10000))) != NULL);
ok1(waypoint->original_id == 1);
ok1((waypoint = waypoints.GetNearestLandable(center, fixed(1))) != NULL);
ok1(waypoint->original_id == 0);
ok1((waypoint = waypoints.GetNearestLandable(center, fixed(10000))) != NULL);
ok1(waypoint->original_id == 0);
ok1((waypoint = waypoints.GetNearestLandable(further, fixed(1))) == NULL);
ok1((waypoint = waypoints.GetNearestLandable(further, fixed(10000))) != NULL);
ok1(waypoint->original_id == 3);
ok1((waypoint = waypoints.GetNearestIf(center, fixed(1), OriginalIDAbove5)) == NULL);
ok1((waypoint = waypoints.GetNearestIf(center, fixed(10000), OriginalIDAbove5)) != NULL);
ok1(waypoint->original_id == 6);
}