MCPcopy
hub / github.com/CesiumGS/cesium / update

Method update

packages/engine/Source/DataSources/KmlDataSource.js:3844–3972  ·  view source on GitHub ↗

* Updates any NetworkLink that require updating. * * @param {JulianDate} time The simulation time. * @returns {boolean} True if this data source is ready to be displayed at the provided time, false otherwise.

(time)

Source from the content-addressed store, hash-verified

3842 * @returns {boolean} True if this data source is ready to be displayed at the provided time, false otherwise.
3843 */
3844 update(time) {
3845 const networkLinks = this._networkLinks;
3846 if (networkLinks.length === 0) {
3847 return true;
3848 }
3849
3850 const now = JulianDate.now();
3851 const that = this;
3852
3853 entitiesToIgnore.removeAll();
3854
3855 function recurseIgnoreEntities(entity) {
3856 const children = entity._children;
3857 const count = children.length;
3858 for (let i = 0; i < count; ++i) {
3859 const child = children[i];
3860 entitiesToIgnore.set(child.id, child);
3861 recurseIgnoreEntities(child);
3862 }
3863 }
3864
3865 let cameraViewUpdate = false;
3866 const lastCameraView = this._lastCameraView;
3867 const camera = this.camera;
3868 if (
3869 defined(camera) &&
3870 !(
3871 camera.positionWC.equalsEpsilon(
3872 lastCameraView.position,
3873 CesiumMath.EPSILON7,
3874 ) &&
3875 camera.directionWC.equalsEpsilon(
3876 lastCameraView.direction,
3877 CesiumMath.EPSILON7,
3878 ) &&
3879 camera.upWC.equalsEpsilon(lastCameraView.up, CesiumMath.EPSILON7)
3880 )
3881 ) {
3882 // Camera has changed so update the last view
3883 lastCameraView.position = Cartesian3.clone(camera.positionWC);
3884 lastCameraView.direction = Cartesian3.clone(camera.directionWC);
3885 lastCameraView.up = Cartesian3.clone(camera.upWC);
3886 lastCameraView.bbox = camera.computeViewRectangle();
3887 cameraViewUpdate = true;
3888 }
3889
3890 const newNetworkLinks = new AssociativeArray();
3891 let changed = false;
3892 networkLinks.values.forEach(function (networkLink) {
3893 const entity = networkLink.entity;
3894 if (entitiesToIgnore.contains(entity.id)) {
3895 return;
3896 }
3897
3898 if (!networkLink.updating) {
3899 let doUpdate = false;
3900 if (networkLink.refreshMode === RefreshMode.INTERVAL) {
3901 if (

Calls 12

setMethod · 0.95
nowMethod · 0.80
removeAllMethod · 0.80
secondsDifferenceMethod · 0.80
greaterThanMethod · 0.80
loadFunction · 0.70
definedFunction · 0.50
equalsEpsilonMethod · 0.45
cloneMethod · 0.45
containsMethod · 0.45

Tested by

no test coverage detected