1 #include <simgear/compiler.h>
2 #include <simgear/constants.h>
7 #include "waypoint.hxx"
9 #if !defined(SG_HAVE_NATIVE_SGI_COMPILERS)
17 route.add_waypoint( SGWayPoint(0, 0, 0, SGWayPoint::CARTESIAN, "Start") );
18 route.add_waypoint( SGWayPoint(1, 0, 0, SGWayPoint::CARTESIAN, "1") );
19 route.add_waypoint( SGWayPoint(2, 0, 0, SGWayPoint::CARTESIAN, "2") );
20 route.add_waypoint( SGWayPoint(2, 2, 0, SGWayPoint::CARTESIAN, "3") );
21 route.add_waypoint( SGWayPoint(4, 2, 0, SGWayPoint::CARTESIAN, "4") );
23 route.set_current( 1 );
25 cout << "( 0.5, 0 ) = " << route.distance_off_route( 0.5, 0 ) << endl;
26 cout << "( 0.5, 1 ) = " << route.distance_off_route( 0.5, 1 ) << endl;
27 cout << "( 0.5, -1 ) = " << route.distance_off_route( 0.5, 1 ) << endl;
29 route.set_current( 3 );
31 cout << "( 2, 4 ) = " << route.distance_off_route( 2, 4 ) << endl;
32 cout << "( 2.5, 4 ) = " << route.distance_off_route( 2.5, 4 ) << endl;