Class RealTimeClock
java.lang.Object
gaiasky.util.time.RealTimeClock
- All Implemented Interfaces:
ITimeFrameProvider
-
Constructor Summary
Constructors -
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 dt in hoursgetTime()Gets the current time in UTC.doubleGets the time in seconds since 1970-01-01T00:00Z (ISO).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
-
Constructor Details
-
RealTimeClock
public RealTimeClock()
-
-
Method Details
-
getHdiff
public double getHdiff()The dt in hours- Specified by:
getHdiffin interfaceITimeFrameProvider- Returns:
- The simulation time difference in hours.
-
getDt
public double getDt()Description copied from interface:ITimeFrameProviderThe frame time difference in seconds.- Specified by:
getDtin interfaceITimeFrameProvider- Returns:
- The frame time difference in seconds.
-
getTime
Description copied from interface:ITimeFrameProviderGets the current time in UTC.- Specified by:
getTimein interfaceITimeFrameProvider- Returns:
- The time as an instant, in UTC.
-
getTimeSeconds
public double getTimeSeconds()Description copied from interface:ITimeFrameProviderGets the time in seconds since 1970-01-01T00:00Z (ISO).- Specified by:
getTimeSecondsin interfaceITimeFrameProvider- Returns:
- The seconds since 1970-01-01T00:00Z (ISO).
-
update
public void update(double dt) Description copied from interface:ITimeFrameProviderUpdates this time frame with the system time difference- Specified by:
updatein interfaceITimeFrameProvider- Parameters:
dt- System time difference in seconds
-
getWarpFactor
public double getWarpFactor()Description copied from interface:ITimeFrameProviderGets the current warp factor- Specified by:
getWarpFactorin interfaceITimeFrameProvider- Returns:
- The warp factor
-
isFixedRateMode
public boolean isFixedRateMode()Description copied from interface:ITimeFrameProviderReturns whether the frame rate is set to fixed or not- Specified by:
isFixedRateModein interfaceITimeFrameProvider- Returns:
- Whether fix rate mode is on
-
getFixedRate
public float getFixedRate()Description copied from interface:ITimeFrameProviderReturns the fixed frame rate if the mode is fixed frame rate. Returns -1 otherwise- Specified by:
getFixedRatein interfaceITimeFrameProvider- Returns:
- The fixed rate
-
isTimeOn
public boolean isTimeOn()Description copied from interface:ITimeFrameProviderIs the time on?- Specified by:
isTimeOnin interfaceITimeFrameProvider- Returns:
- True if time is on
-