Package gaiasky.util.time
Interface ITimeFrameProvider
- All Known Implementing Classes:
GlobalClock,RealTimeClock
public interface ITimeFrameProvider
-
Method Summary
Modifier and TypeMethodDescriptiondoublegetDt()The frame time difference in seconds.floatReturns the fixed frame rate if the mode is fixed frame rate.doublegetHdiff()The simulation time difference in hours.getTime()Gets the current time in UTC.doubleGets the current warp factorbooleanReturns whether the frame rate is set to fixed or notbooleanisTimeOn()Is the time on?voidupdate(double dt) Updates this time frame with the system time difference
-
Method Details
-
getHdiff
double getHdiff()The simulation time difference in hours.- Returns:
- The simulation time difference in hours.
-
getDt
double getDt()The frame time difference in seconds.- Returns:
- The frame time difference in seconds.
-
getTime
Instant getTime()Gets the current time in UTC.- Returns:
- The time as an instant, in UTC.
-
update
void update(double dt) Updates this time frame with the system time difference- Parameters:
dt- System time difference in seconds
-
getWarpFactor
double getWarpFactor()Gets the current warp factor- Returns:
- The warp factor
-
isTimeOn
boolean isTimeOn()Is the time on?- Returns:
- True if time is on
-
isFixedRateMode
boolean isFixedRateMode()Returns whether the frame rate is set to fixed or not- Returns:
- Whether fix rate mode is on
-
getFixedRate
float getFixedRate()Returns the fixed frame rate if the mode is fixed frame rate. Returns -1 otherwise- Returns:
- The fixed rate
-