openspace.time
Functions overview
Name |
Documentation |
---|---|
Modifies the passed time (first argument) by the delta time (second argument) |
|
Converts the given time to either a J2000 seconds number or a ISO 8601 timestamp, depending on the type of the given time |
|
Returns the current application time as the number of seconds since the OpenSpace application started |
|
Returns the current time as the number of seconds since the J2000 epoch |
|
Returns the current wall time as an ISO 8601 date string (YYYY-MM-DDTHH-MN-SS) in the UTC timezone |
|
Returns the amount of simulated time that passes in one second of real time |
|
Sets the amount of simulation time that happens in one second of real time |
|
Interpolate the simulation speed to the first delta time step in the list that is larger than the current simulation speed, if any |
|
Same behaviour as setPause, but with interpolation |
|
Interpolate the simulation speed to the first delta time step in the list that is smaller than the current simulation speed, if any |
|
Sets the current simulation time to the specified value |
|
Increments the current simulation time by the specified number of seconds |
|
Toggles the pause function, i |
|
Returns whether the simulation time is currently paused or is progressing |
|
This allows for a keypress (via keybinding) to have dual functionality |
|
Sets the amount of simulation time that happens in one second of real time |
|
Sets the list of discrete delta time steps for the simulation speed that can be quickly jumped between |
|
Immediately set the simulation speed to the first delta time step in the list that is larger than the current choice of simulation speed, if any |
|
Toggles a pause function i |
|
Immediately set the simulation speed to the first delta time step in the list that is smaller than the current choice of simulation speed if any |
|
Sets the current simulation time to the specified value |
|
Returns the current time as an date string of the form (YYYY MON DDTHR:MN:SC |
|
Toggles the pause function, i |
|
Returns the current time as an ISO 8601 date string (YYYY-MM-DDTHH:MN:SS) |
Functions
advancedTime
Modifies the passed time (first argument) by the delta time (second argument). The first argument can either be an ISO 8601 date string or the number of seconds past the J2000 epoch. The second argument can either be a string of the form [-]XX(s,m,h,d,M,y] with (s)econds, (m)inutes, (h)ours, (d)ays, (M)onths, and (y)ears as units and an optional - sign to move backwards in time. If the second argument is a number, it is interpreted as a number of seconds. The return value is of the same type as the first argument.
base
String | Number
change
String | Number
Return type: String | Number
openspace.time.advancedTime(base, change)
convertTime
Converts the given time to either a J2000 seconds number or a ISO 8601 timestamp, depending on the type of the given time.
If the given time is a timestamp: the function returns a double precision value representing the ephemeris version of that time; that is the number of TDB seconds past the J2000 epoch.
If the given time is a J2000 seconds value: the function returns a ISO 8601 timestamp.
time
String | Number
Return type: String | Number
openspace.time.convertTime(time)
currentApplicationTime
Returns the current application time as the number of seconds since the OpenSpace application started.
Return type: Number
openspace.time.currentApplicationTime()
currentTime
Returns the current time as the number of seconds since the J2000 epoch.
Return type: Number
openspace.time.currentTime()
currentWallTime
Returns the current wall time as an ISO 8601 date string (YYYY-MM-DDTHH-MN-SS) in the UTC timezone.
Return type: String
openspace.time.currentWallTime()
deltaTime
Returns the amount of simulated time that passes in one second of real time.
Return type: Number
openspace.time.deltaTime()
interpolateDeltaTime
Sets the amount of simulation time that happens in one second of real time. If a second input value is given, the interpolation is done over the specified number of seconds.
deltaTime
Number
interpolationDuration
Number?
Return type: void
openspace.time.interpolateDeltaTime(deltaTime, interpolationDuration)
interpolateNextDeltaTimeStep
Interpolate the simulation speed to the first delta time step in the list that is larger than the current simulation speed, if any. If an input value is given, the interpolation is done over the specified number of seconds.
interpolationDuration
Number?
Return type: void
openspace.time.interpolateNextDeltaTimeStep(interpolationDuration)
interpolatePause
Same behaviour as setPause, but with interpolation. If no interpolation duration is provided, the interpolation time will be based on the defaultPauseInterpolationDuration
and defaultUnpauseInterpolationDuration
properties of the TimeManager.
isPaused
Boolean
interpolationDuration
Number?
Return type: void
openspace.time.interpolatePause(isPaused, interpolationDuration)
interpolatePreviousDeltaTimeStep
Interpolate the simulation speed to the first delta time step in the list that is smaller than the current simulation speed, if any. If an input value is given, the interpolation is done over the specified number of seconds.
interpolationDuration
Number?
Return type: void
openspace.time.interpolatePreviousDeltaTimeStep(interpolationDuration)
interpolateTime
Sets the current simulation time to the specified value. If the first parameter is a number, the target is the number of seconds past the J2000 epoch. If it is a string, it has to be a valid ISO 8601-like date string of the format YYYY-MM-DDTHH:MN:SS (Note: providing time zone using the Z format is not supported. UTC is assumed). If a second input value is given, the interpolation is done over the specified number of seconds.
time
String | Number
interpolationDutation
Number?
Return type: void
openspace.time.interpolateTime(time, interpolationDutation)
interpolateTimeRelative
Increments the current simulation time by the specified number of seconds. If a second input value is given, the interpolation is done over the specified number of seconds.
delta
Number
interpolationDuration
Number?
Return type: void
openspace.time.interpolateTimeRelative(delta, interpolationDuration)
interpolateTogglePause
Toggles the pause function, i.e. temporarily setting the delta time to 0 and restoring it afterwards. If an input value is given, the interpolation is done over the specified number of seconds.
interpolationDuration
Number?
Return type: void
openspace.time.interpolateTogglePause(interpolationDuration)
isPaused
Returns whether the simulation time is currently paused or is progressing.
Return type: Boolean
openspace.time.isPaused()
pauseToggleViaKeyboard
This allows for a keypress (via keybinding) to have dual functionality. In normal operational mode it will behave just like time_interpolateTogglePause, but during playback of a session recording it will pause the playback without manipulating the delta time.
Return type: void
openspace.time.pauseToggleViaKeyboard()
setDeltaTime
Sets the amount of simulation time that happens in one second of real time.
deltaTime
Number
Return type: void
openspace.time.setDeltaTime(deltaTime)
setDeltaTimeSteps
Sets the list of discrete delta time steps for the simulation speed that can be quickly jumped between. The list will be sorted to be in increasing order. A negative verison of each specified time step will be added per default as well.
deltaTime
Number[]
Return type: void
openspace.time.setDeltaTimeSteps(deltaTime)
setNextDeltaTimeStep
Immediately set the simulation speed to the first delta time step in the list that is larger than the current choice of simulation speed, if any.
Return type: void
openspace.time.setNextDeltaTimeStep()
setPause
Toggles a pause function i.e. setting the delta time to 0 and restoring it afterwards.
isPaused
Boolean
Return type: void
openspace.time.setPause(isPaused)
setPreviousDeltaTimeStep
Immediately set the simulation speed to the first delta time step in the list that is smaller than the current choice of simulation speed if any.
Return type: void
openspace.time.setPreviousDeltaTimeStep()
setTime
Sets the current simulation time to the specified value. If the parameter is a number, the value is the number of seconds past the J2000 epoch. If it is a string, it has to be a valid ISO 8601-like date string of the format YYYY-MM-DDTHH:MN:SS. Note: providing time zone using the Z format is not supported. UTC is assumed.
time
Number | String
Return type: void
openspace.time.setTime(time)
SPICE
Returns the current time as an date string of the form (YYYY MON DDTHR:MN:SC.### ::RND) as returned by SPICE.
Return type: String
openspace.time.SPICE()
togglePause
Toggles the pause function, i.e. temporarily setting the delta time to 0 and restoring it afterwards.
Return type: void
openspace.time.togglePause()
UTC
Returns the current time as an ISO 8601 date string (YYYY-MM-DDTHH:MN:SS).
Return type: String
openspace.time.UTC()