Global Positioning System Reference
In-Depth Information
final protected void move()
{
Route route = board.getLink( myOrigin, myDestination );
int secsToMove = settings.getTimeToMove(); // [s]
double distance = route.getTotalDistance(); // [km]
double speed = distance / secsToMove * 1000; // [m/s]
moveOnRoute( route, speed ); // returns immediately
myOrigin = myDestination; // for next route calculations
}
The move should be validated before submission to retrieve the Link , which
is a Route from the digital map. With the given route, the player can
calculate the overall speed according to the game logic.
In the process of the game design, a new method is introduced to the
RealObject . The method moveOnRoute(speed) is an interpolation between
move(dir,speed) and similar to the playback thread. The idea is to tie
the RO's motion to a xed route with implicit triggers to change direction
and simply accelerate or decelerate the object according to environmental
constraints. While the playback is completely automated and placed in the
GPSunit , this method is part of the RO.
Note: A Route does not describe an actual path. It is only a sequential
collection of geographic points. As long as the route is driven as the crow
flies, the total distance can be calculated. As soon as a route is fed into
a navigation system, the system calculates a path along roads of the map.
Different systems can use different algorithms and map data resulting in
different paths, duration, and distance.
 
Search WWH ::




Custom Search