qd-changjing/public/static/Build/Documentation/Clock.html

1314 lines
67 KiB
HTML
Raw Permalink Normal View History

2022-07-05 16:56:29 +08:00
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Clock - Cesium Documentation</title>
<!--[if lt IE 9]>
<script src="javascript/html5.js"></script>
<![endif]-->
<link href="styles/jsdoc-default.css" rel="stylesheet">
<link href="styles/prism.css" rel="stylesheet">
</head>
<body>
<div id="main">
<h1 class="page-title">
<a href="index.html"><img src="Images/CesiumLogo.png" class="cesiumLogo"></a>
Clock
<div class="titleCenterer"></div>
</h1>
<section>
<header>
</header>
<article>
<div class="container-overview">
<div class="nameContainer">
<h4 class="name" id="Clock">
<a href="#Clock" class="doc-link"></a>
new Cesium.Clock<span class="signature">(<span class="optional">options</span>)</span>
<div class="source-link rightLinks">
<a href="https://github.com/CesiumGS/cesium/blob/1.91/Source/Core/Clock.js#L43">Core/Clock.js 43</a>
</div>
</h4>
</div>
<div class="description">
A simple clock for keeping track of simulated time.
</div>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>options</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last">
<span class="optional">optional</span>
Object with the following properties:
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Default</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>startTime</code></td>
<td class="type">
<span class="param-type"><a href="JulianDate.html">JulianDate</a></span>
</td>
<td class="default">
</td>
<td class="description last">
<span class="optional">optional</span>
The start time of the clock.</td>
</tr>
<tr>
<td class="name"><code>stopTime</code></td>
<td class="type">
<span class="param-type"><a href="JulianDate.html">JulianDate</a></span>
</td>
<td class="default">
</td>
<td class="description last">
<span class="optional">optional</span>
The stop time of the clock.</td>
</tr>
<tr>
<td class="name"><code>currentTime</code></td>
<td class="type">
<span class="param-type"><a href="JulianDate.html">JulianDate</a></span>
</td>
<td class="default">
</td>
<td class="description last">
<span class="optional">optional</span>
The current time.</td>
</tr>
<tr>
<td class="name"><code>multiplier</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="default">
<code class="language-javascript">1.0</code>
</td>
<td class="description last">
<span class="optional">optional</span>
Determines how much time advances when <a href="Clock.html#tick"><code>Clock#tick</code></a> is called, negative values allow for advancing backwards.</td>
</tr>
<tr>
<td class="name"><code>clockStep</code></td>
<td class="type">
<span class="param-type"><a href="global.html#ClockStep">ClockStep</a></span>
</td>
<td class="default">
<code class="language-javascript">ClockStep.SYSTEM_CLOCK_MULTIPLIER</code>
</td>
<td class="description last">
<span class="optional">optional</span>
Determines if calls to <a href="Clock.html#tick"><code>Clock#tick</code></a> are frame dependent or system clock dependent.</td>
</tr>
<tr>
<td class="name"><code>clockRange</code></td>
<td class="type">
<span class="param-type"><a href="global.html#ClockRange">ClockRange</a></span>
</td>
<td class="default">
<code class="language-javascript">ClockRange.UNBOUNDED</code>
</td>
<td class="description last">
<span class="optional">optional</span>
Determines how the clock should behave when <a href="Clock.html#startTime"><code>Clock#startTime</code></a> or <a href="Clock.html#stopTime"><code>Clock#stopTime</code></a> is reached.</td>
</tr>
<tr>
<td class="name"><code>canAnimate</code></td>
<td class="type">
<span class="param-type">Boolean</span>
</td>
<td class="default">
<code class="language-javascript">true</code>
</td>
<td class="description last">
<span class="optional">optional</span>
Indicates whether <a href="Clock.html#tick"><code>Clock#tick</code></a> can advance time. This could be false if data is being buffered, for example. The clock will only tick when both <a href="Clock.html#canAnimate"><code>Clock#canAnimate</code></a> and <a href="Clock.html#shouldAnimate"><code>Clock#shouldAnimate</code></a> are true.</td>
</tr>
<tr>
<td class="name"><code>shouldAnimate</code></td>
<td class="type">
<span class="param-type">Boolean</span>
</td>
<td class="default">
<code class="language-javascript">false</code>
</td>
<td class="description last">
<span class="optional">optional</span>
Indicates whether <a href="Clock.html#tick"><code>Clock#tick</code></a> should attempt to advance time. The clock will only tick when both <a href="Clock.html#canAnimate"><code>Clock#canAnimate</code></a> and <a href="Clock.html#shouldAnimate"><code>Clock#shouldAnimate</code></a> are true.</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<h5>Throws:</h5>
<ul>
<li>
<div class="param-desc">
<span class="param-type"><a href="DeveloperError.html">DeveloperError</a></span>
: startTime must come before stopTime.
</div>
</li>
</ul>
<dl class="details">
<h5>Example:</h5>
<pre><code class="language-javascript">// Create a clock that loops on Christmas day 2013 and runs in real-time.
const clock = new Cesium.Clock({
startTime : Cesium.JulianDate.fromIso8601("2013-12-25"),
currentTime : Cesium.JulianDate.fromIso8601("2013-12-25"),
stopTime : Cesium.JulianDate.fromIso8601("2013-12-26"),
clockRange : Cesium.ClockRange.LOOP_STOP,
clockStep : Cesium.ClockStep.SYSTEM_CLOCK_MULTIPLIER
});</code></pre>
<h5>See:</h5>
<ul class="see-list">
<li><a href="global.html#ClockStep">ClockStep</a></li>
<li><a href="global.html#ClockRange">ClockRange</a></li>
<li><a href="JulianDate.html">JulianDate</a></li>
</ul>
</dl>
</div>
<h3 class="subsection-title">Members</h3>
<div class="nameContainer">
<h4 class="name" id="canAnimate">
<a href="#canAnimate" class="doc-link"></a>
canAnimate<span class="type-signature"> : Boolean</span>
<div class="source-link rightLinks">
<a href="https://github.com/CesiumGS/cesium/blob/1.91/Source/Core/Clock.js#L115">Core/Clock.js 115</a>
</div>
</h4>
</div>
<div class="description">
Indicates whether <a href="Clock.html#tick"><code>Clock#tick</code></a> can advance time. This could be false if data is being buffered,
for example. The clock will only advance time when both
<a href="Clock.html#canAnimate"><code>Clock#canAnimate</code></a> and <a href="Clock.html#shouldAnimate"><code>Clock#shouldAnimate</code></a> are true.
</div>
<dl class="details">
<span class="details-header">Default Value:</span>
<code class="language-javascript">true</code>
</dl>
<div class="nameContainer">
<h4 class="name" id="clockRange">
<a href="#clockRange" class="doc-link"></a>
clockRange<span class="type-signature"> : <a href="global.html#ClockRange">ClockRange</a></span>
<div class="source-link rightLinks">
<a href="https://github.com/CesiumGS/cesium/blob/1.91/Source/Core/Clock.js#L106">Core/Clock.js 106</a>
</div>
</h4>
</div>
<div class="description">
Determines how the clock should behave when
<a href="Clock.html#startTime"><code>Clock#startTime</code></a> or <a href="Clock.html#stopTime"><code>Clock#stopTime</code></a>
is reached.
</div>
<dl class="details">
<span class="details-header">Default Value:</span>
<code class="language-javascript"><a href="global.html#ClockRange#.UNBOUNDED"><code>ClockRange.UNBOUNDED</code></a></code>
</dl>
<div class="nameContainer">
<h4 class="name" id="clockStep">
<a href="#clockStep" class="doc-link"></a>
clockStep<span class="type-signature"> : <a href="global.html#ClockStep">ClockStep</a></span>
<div class="source-link rightLinks">
<a href="https://github.com/CesiumGS/cesium/blob/1.91/Source/Core/Clock.js#L210">Core/Clock.js 210</a>
</div>
</h4>
</div>
<div class="description">
Determines if calls to <a href="Clock.html#tick"><code>Clock#tick</code></a> are frame dependent or system clock dependent.
Changing this property to <a href="global.html#ClockStep#.SYSTEM_CLOCK"><code>ClockStep.SYSTEM_CLOCK</code></a> will set
<a href="Clock.html#multiplier"><code>Clock#multiplier</code></a> to 1.0, <a href="Clock.html#shouldAnimate"><code>Clock#shouldAnimate</code></a> to true, and
<a href="Clock.html#currentTime"><code>Clock#currentTime</code></a> to the current system clock time.
</div>
<dl class="details">
<span class="details-header">Default Value:</span>
<code class="language-javascript"><a href="global.html#ClockStep#.SYSTEM_CLOCK_MULTIPLIER"><code>ClockStep.SYSTEM_CLOCK_MULTIPLIER</code></a></code>
</dl>
<div class="nameContainer">
<h4 class="name" id="currentTime">
<a href="#currentTime" class="doc-link"></a>
currentTime<span class="type-signature"> : <a href="JulianDate.html">JulianDate</a></span>
<div class="source-link rightLinks">
<a href="https://github.com/CesiumGS/cesium/blob/1.91/Source/Core/Clock.js#L155">Core/Clock.js 155</a>
</div>
</h4>
</div>
<div class="description">
The current time.
Changing this property will change
<a href="Clock.html#clockStep"><code>Clock#clockStep</code></a> from <a href="global.html#ClockStep#.SYSTEM_CLOCK"><code>ClockStep.SYSTEM_CLOCK</code></a> to
<a href="global.html#ClockStep#.SYSTEM_CLOCK_MULTIPLIER"><code>ClockStep.SYSTEM_CLOCK_MULTIPLIER</code></a>.
</div>
<dl class="details">
</dl>
<div class="nameContainer">
<h4 class="name" id="multiplier">
<a href="#multiplier" class="doc-link"></a>
multiplier<span class="type-signature"> : Number</span>
<div class="source-link rightLinks">
<a href="https://github.com/CesiumGS/cesium/blob/1.91/Source/Core/Clock.js#L184">Core/Clock.js 184</a>
</div>
</h4>
</div>
<div class="description">
Gets or sets how much time advances when <a href="Clock.html#tick"><code>Clock#tick</code></a> is called. Negative values allow for advancing backwards.
If <a href="Clock.html#clockStep"><code>Clock#clockStep</code></a> is set to <a href="global.html#ClockStep#.TICK_DEPENDENT"><code>ClockStep.TICK_DEPENDENT</code></a>, this is the number of seconds to advance.
If <a href="Clock.html#clockStep"><code>Clock#clockStep</code></a> is set to <a href="global.html#ClockStep#.SYSTEM_CLOCK_MULTIPLIER"><code>ClockStep.SYSTEM_CLOCK_MULTIPLIER</code></a>, this value is multiplied by the
elapsed system time since the last call to <a href="Clock.html#tick"><code>Clock#tick</code></a>.
Changing this property will change
<a href="Clock.html#clockStep"><code>Clock#clockStep</code></a> from <a href="global.html#ClockStep#.SYSTEM_CLOCK"><code>ClockStep.SYSTEM_CLOCK</code></a> to
<a href="global.html#ClockStep#.SYSTEM_CLOCK_MULTIPLIER"><code>ClockStep.SYSTEM_CLOCK_MULTIPLIER</code></a>.
</div>
<dl class="details">
<span class="details-header">Default Value:</span>
<code class="language-javascript">1.0</code>
</dl>
<div class="nameContainer">
<h4 class="name" id="onStop">
<a href="#onStop" class="doc-link"></a>
onStop<span class="type-signature"> : <a href="Event.html">Event</a></span>
<div class="source-link rightLinks">
<a href="https://github.com/CesiumGS/cesium/blob/1.91/Source/Core/Clock.js#L126">Core/Clock.js 126</a>
</div>
</h4>
</div>
<div class="description">
An <a href="Event.html"><code>Event</code></a> that is fired whenever <a href="Clock.html#stopTime"><code>Clock#stopTime</code></a> is reached.
</div>
<dl class="details">
</dl>
<div class="nameContainer">
<h4 class="name" id="onTick">
<a href="#onTick" class="doc-link"></a>
onTick<span class="type-signature"> : <a href="Event.html">Event</a></span>
<div class="source-link rightLinks">
<a href="https://github.com/CesiumGS/cesium/blob/1.91/Source/Core/Clock.js#L121">Core/Clock.js 121</a>
</div>
</h4>
</div>
<div class="description">
An <a href="Event.html"><code>Event</code></a> that is fired whenever <a href="Clock.html#tick"><code>Clock#tick</code></a> is called.
</div>
<dl class="details">
</dl>
<div class="nameContainer">
<h4 class="name" id="shouldAnimate">
<a href="#shouldAnimate" class="doc-link"></a>
shouldAnimate<span class="type-signature"> : Boolean</span>
<div class="source-link rightLinks">
<a href="https://github.com/CesiumGS/cesium/blob/1.91/Source/Core/Clock.js#L236">Core/Clock.js 236</a>
</div>
</h4>
</div>
<div class="description">
Indicates whether <a href="Clock.html#tick"><code>Clock#tick</code></a> should attempt to advance time.
The clock will only advance time when both
<a href="Clock.html#canAnimate"><code>Clock#canAnimate</code></a> and <a href="Clock.html#shouldAnimate"><code>Clock#shouldAnimate</code></a> are true.
Changing this property will change
<a href="Clock.html#clockStep"><code>Clock#clockStep</code></a> from <a href="global.html#ClockStep#.SYSTEM_CLOCK"><code>ClockStep.SYSTEM_CLOCK</code></a> to
<a href="global.html#ClockStep#.SYSTEM_CLOCK_MULTIPLIER"><code>ClockStep.SYSTEM_CLOCK_MULTIPLIER</code></a>.
</div>
<dl class="details">
<span class="details-header">Default Value:</span>
<code class="language-javascript">false</code>
</dl>
<div class="nameContainer">
<h4 class="name" id="startTime">
<a href="#startTime" class="doc-link"></a>
startTime<span class="type-signature"> : <a href="JulianDate.html">JulianDate</a></span>
<div class="source-link rightLinks">
<a href="https://github.com/CesiumGS/cesium/blob/1.91/Source/Core/Clock.js#L91">Core/Clock.js 91</a>
</div>
</h4>
</div>
<div class="description">
The start time of the clock.
</div>
<dl class="details">
</dl>
<div class="nameContainer">
<h4 class="name" id="stopTime">
<a href="#stopTime" class="doc-link"></a>
stopTime<span class="type-signature"> : <a href="JulianDate.html">JulianDate</a></span>
<div class="source-link rightLinks">
<a href="https://github.com/CesiumGS/cesium/blob/1.91/Source/Core/Clock.js#L97">Core/Clock.js 97</a>
</div>
</h4>
</div>
<div class="description">
The stop time of the clock.
</div>
<dl class="details">
</dl>
<h3 class="subsection-title">Methods</h3>
<div class="nameContainer">
<h4 class="name" id="tick">
<a href="#tick" class="doc-link"></a>
tick<span class="signature">()</span> &rarr; <span class="type-signature returnType"><a href="JulianDate.html">JulianDate</a></span>
<div class="source-link rightLinks">
<a href="https://github.com/CesiumGS/cesium/blob/1.91/Source/Core/Clock.js#L261">Core/Clock.js 261</a>
</div>
</h4>
</div>
<div class="description">
Advances the clock from the current time based on the current configuration options.
tick should be called every frame, regardless of whether animation is taking place
or not. To control animation, use the <a href="Clock.html#shouldAnimate"><code>Clock#shouldAnimate</code></a> property.
</div>
<h5>Returns:</h5>
<div class="param-desc">
The new value of the <a href="Clock.html#currentTime"><code>Clock#currentTime</code></a> property.
</div>
<dl class="details">
</dl>
</article>
</section>
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.10</a>
</footer>
</div>
<div class="nav">
<div class="menu">
<input type="text" class="classFilter" id="ClassFilter" placeholder="Search">
<ul id="ClassList"><li data-name="Animation"><a href="Animation.html">Animation</a></li><li data-name="AnimationViewModel"><a href="AnimationViewModel.html">AnimationViewModel</a></li><li data-name="Appearance"><a href="Appearance.html">Appearance</a></li><li data-name="ArcGisMapServerImageryProvider"><a href="ArcGisMapServerImageryProvider.html">ArcGisMapServerImageryProvider</a></li><li data-name="ArcGISTiledElevationTerrainProvider"><a href="ArcGISTiledElevationTerrainProvider.html">ArcGISTiledElevationTerrainProvider</a></li><li data-name="ArcType"><a href="global.html#ArcType">ArcType</a></li><li data-name="AssociativeArray"><a href="AssociativeArray.html">AssociativeArray</a></li><li data-name="Axis"><a href="global.html#Axis">Axis</a></li><li data-name="AxisAlignedBoundingBox"><a href="AxisAlignedBoundingBox.html">AxisAlignedBoundingBox</a></li><li data-name="backFaceCulling"><a href="global.html#backFaceCulling">backFaceCulling</a></li><li data-name="barycentricCoordinates"><a href="global.html#barycentricCoordinates">barycentricCoordinates</a></li><li data-name="BaseLayerPicker"><a href="BaseLayerPicker.html">BaseLayerPicker</a></li><li data-name="BaseLayerPickerViewModel"><a href="BaseLayerPickerViewModel.html">BaseLayerPickerViewModel</a></li><li data-name="Billboard"><a href="Billboard.html">Billboard</a></li><li data-name="BillboardCollection"><a href="BillboardCollection.html">BillboardCollection</a></li><li data-name="BillboardGraphics"><a href="BillboardGraphics.html">BillboardGraphics</a></li><li data-name="BillboardVisualizer"><a href="BillboardVisualizer.html">BillboardVisualizer</a></li><li data-name="binarySearch"><a href="global.html#binarySearch">binarySearch</a></li><li data-name="binarySearchComparator"><a href="global.html#binarySearchComparator">binarySearchComparator</a></li><li data-name="BingMapsGeocoderService"><a href="BingMapsGeocoderService.html">BingMapsGeocoderService</a></li><li data-name="BingMapsImageryProvider"><a href="BingMapsImageryProvider.html">BingMapsImageryProvider</a></li><li data-name="BingMapsStyle"><a href="global.html#BingMapsStyle">BingMapsStyle</a></li><li data-name="BlendEquation"><a href="global.html#BlendEquation">BlendEquation</a></li><li data-name="BlendFunction"><a href="global.html#BlendFunction">BlendFunction</a></li><li data-name="BlendingState"><a href="BlendingState.html">BlendingState</a></li><li data-name="BlendOption"><a href="global.html#BlendOption">BlendOption</a></li><li data-name="BoundingRectangle"><a href="BoundingRectangle.html">BoundingRectangle</a></li><li data-name="BoundingSphere"><a href="BoundingSphere.html">BoundingSphere</a></li><li data-name="boundingSphere"><a href="global.html#boundingSphere">boundingSphere</a></li><li data-name="BoxEmitter"><a href="BoxEmitter.html">BoxEmitter</a></li><li data-name="BoxGeometry"><a href="BoxGeometry.html">BoxGeometry</a></li><li data-name="BoxGeometryUpdater"><a href="BoxGeometryUpdater.html">BoxGeometryUpdater</a></li><li data-name="BoxGraphics"><a href="BoxGraphics.html">BoxGraphics</a></li><li data-name="BoxOutlineGeometry"><a href="BoxOutlineGeometry.html">BoxOutlineGeometry</a></li><li data-name="buildModuleUrl"><a href="global.html#buildModuleUrl">buildModuleUrl</a></li><li data-name="CallbackProperty"><a href="CallbackProperty.html">CallbackProperty</a></li><li data-name="Camera"><a href="Camera.html">Camera</a></li><li data-name="CameraEventAggregator"><a href="CameraEventAggregator.html">CameraEventAggregator</a></li><li data-name="CameraEventType"><a href="global.html#CameraEventType">CameraEventType</a></li><li data-name="cancelAnimationFrame"><a href="global.html#cancelAnimationFrame">cancelAnimationFrame</a></li><li data-name="Cartesian2"><a href="Cartesian2.html">Cartesian2</a></li><li data-name="Cartesian3"><a href="Cartesian3.html">Cartesian3</a></li><li data-name="Cartesian4"><a href="Cartesian4.html">Cartesian4</a></li><li data-name="Cartographic"><a href="Cartographic.html">Cartographic</a></li><li data-name="CartographicGeocoderService"><a href="CartographicGeocoderServic
</div>
</div>
<script>
if (window.frameElement) {
document.body.className = 'embedded';
var ele = document.createElement('a');
ele.className = 'popout';
ele.target = '_blank';
ele.href = window.location.href;
ele.title = 'Pop out';
document.getElementById('main').appendChild(ele);
}
// Set targets on external links. Sandcastle and GitHub shouldn't be embedded in any iframe.
Array.prototype.forEach.call(document.getElementsByTagName('a'), function(a) {
if (/^https?:/i.test(a.getAttribute('href'))) {
a.target='_blank';
}
});
</script>
<script src="javascript/prism.js"></script>
<script src="javascript/cesiumDoc.js"></script>
</body>
</html>