terrain now takes the track into consideration
track now can tell the closest point to a given vector