]> git.mxchange.org Git - simgear.git/blob - simgear/route/routetest.cxx
FG_ to SG_ namespace changes.
[simgear.git] / simgear / route / routetest.cxx
1 #include <simgear/constants.h>
2
3 #include "route.hxx"
4 #include "waypoint.hxx"
5
6 int main() {
7     SGRoute route;
8
9     route.add_waypoint( SGWayPoint(0, 0, 0, SGWayPoint::CARTESIAN, "Start") );
10     route.add_waypoint( SGWayPoint(1, 0, 0, SGWayPoint::CARTESIAN, "1") );
11     route.add_waypoint( SGWayPoint(2, 0, 0, SGWayPoint::CARTESIAN, "2") );
12     route.add_waypoint( SGWayPoint(2, 2, 0, SGWayPoint::CARTESIAN, "3") );
13     route.add_waypoint( SGWayPoint(4, 2, 0, SGWayPoint::CARTESIAN, "4") );
14    
15     route.set_current( 1 );
16
17     cout << "( 0.5, 0 ) = " << route.distance_off_route( 0.5, 0 ) << endl;
18     cout << "( 0.5, 1 ) = " << route.distance_off_route( 0.5, 1 ) << endl;
19     cout << "( 0.5, -1 ) = " << route.distance_off_route( 0.5, 1 ) << endl;
20
21     route.set_current( 3 );
22
23     cout << "( 2, 4 ) = " << route.distance_off_route( 2, 4 ) << endl;
24     cout << "( 2.5, 4 ) = " << route.distance_off_route( 2.5, 4 ) << endl;
25
26     return 0;
27 }