- // Initialize the time related variables
- void init( double lon, double lat, const string& root );
-
- // Update the time related variables
- void update( double lon, double lat, double alt_m, long int warp );
-
- // Given lon/lat, update timezone information and local_offset
- void updateLocal( double lon, double lat, const string& root );
-
- // given Julian Date and Longitude (decimal degrees West) compute
- // Local Sidereal Time, in decimal hours.
- //
- // Provided courtesy of ecdowney@noao.edu (Elwood Downey)
- double sidereal_precise( double lng );
+ /**
+ * Update the time related variables.
+ * The update() method requires you to pass in your position and
+ * an optional time offset in seconds. The offset (or warp) allows
+ * you to offset "sim" time relative to "real" time. The update()
+ * method is designed to be called by the host application before
+ * every frame.
+ * @param lon_rad current longitude (radians)
+ * @param lat_rad current latitude (radians)
+ * @param ct specify a unix time, otherwise specify 0 to use current
+ clock time
+ * @param warp an optional time offset specified in seconds. This
+ * allows us to advance or rewind "time" if we choose to. */
+ void update( double lon_rad, double lat_rad, time_t ct, long int warp );
+
+ /**
+ * Given lon/lat, update timezone information and local_offset
+ * The updateLocal() method is intended to be called less
+ * frequently - only when your position is likely to be changed
+ * enough that your timezone may have changed as well. In the
+ * FlightGear project we call updateLocal() every few minutes from
+ * our periodic event manager.
+ * @param lon_rad current longitude (radians)
+ * @param lat_rad current latitude (radians)
+ * @param root base path containing time zone directory */
+ void updateLocal( double lon_rad, double lat_rad, const std::string& root );
+
+ /** @return current system/unix time in seconds */
+ inline time_t get_cur_time() const { return cur_time; };