From b971f4e5d7511d28817c5f2a17cd0517a311a1ce Mon Sep 17 00:00:00 2001 From: "jerome.fayot" Date: Thu, 29 Aug 2024 15:49:39 +0200 Subject: [PATCH 1/5] added CallbackPositionProperty --- .../gallery/Callback Position Property.html | 217 ++++++++++++++++++ .../gallery/Callback Position Property.jpg | Bin 0 -> 17551 bytes CHANGES.md | 1 + CONTRIBUTORS.md | 3 +- .../DataSources/CallbackPositionProperty.js | 173 ++++++++++++++ .../Source/DataSources/PathVisualizer.js | 64 ++++++ .../Source/DataSources/PositionProperty.js | 1 + .../CallbackPositionPropertySpec.js | 196 ++++++++++++++++ .../ConstantPositionPropertySpec.js | 2 +- 9 files changed, 655 insertions(+), 2 deletions(-) create mode 100644 Apps/Sandcastle/gallery/Callback Position Property.html create mode 100644 Apps/Sandcastle/gallery/Callback Position Property.jpg create mode 100644 packages/engine/Source/DataSources/CallbackPositionProperty.js create mode 100644 packages/engine/Specs/DataSources/CallbackPositionPropertySpec.js diff --git a/Apps/Sandcastle/gallery/Callback Position Property.html b/Apps/Sandcastle/gallery/Callback Position Property.html new file mode 100644 index 00000000000..e95cd9e82db --- /dev/null +++ b/Apps/Sandcastle/gallery/Callback Position Property.html @@ -0,0 +1,217 @@ + + + + + + + + + Cesium Demo + + + + + + +
+

Loading...

+
+ + + diff --git a/Apps/Sandcastle/gallery/Callback Position Property.jpg b/Apps/Sandcastle/gallery/Callback Position Property.jpg new file mode 100644 index 0000000000000000000000000000000000000000..3a4c588906fa96714f81866f942709e0d50ec5cd GIT binary patch literal 17551 zcmeHtby!x<^XMT3=@jXZkZySC?vw_J7kKIJ?oN@G21!9dKtM{QOH#T+Ku}6r;2!wY z_x_$=JomZxzx!R!Vdvf1ncbb4oinrR?ab{8fUO`SF9X2A!2|r@Kj3y1_$}>aZ2nInAuALD!mCyekX%z8KZe<}ZreY=WjV&&%M zB*4bz;K~X$cQl2unmO9Dc|o1nI9S=)03lH?C#ab%%#G3%W@+spOugUSPEBcTE=;Y% zqs*@CB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n%jM zcQ5m!8NVccIO1h~j?+X$X#+PQQ&ev}>zULboh>R!jgE3G@w1D{vX-X6t6ShXkqQAr z2(Ys(c#@nSL+es>Wh~>+(p~tfpc0`w@X2g<^%wWRmi0J^_a1|NA4+pdUkHqm25tconf+prx=c~QPR!n_NKwl_FL)E zT4nJ|h5`kFwTZ`rVY|gx2UkvJ)|=GJ+P3kS3V?1eNk!oZ>sf0zVmD({6U*E(tIIWE z(;+>D_SqMO?EV+t58?xkJp|K!-vU9R{17Rrl6Bi^+k9eMz;noA(LsZM`Z|xpvthclO3$aA&I{*Lx literal 0 HcmV?d00001 diff --git a/CHANGES.md b/CHANGES.md index 3a5a5ce448f..ca4dd030145 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -9,6 +9,7 @@ - Enable MSAA by default with 4 samples. To turn MSAA off set `scene.msaaSamples = 1` [#12158](https://github.com/CesiumGS/cesium/pull/12158) - Made the `time` parameter optional for `Property`, using `JulianDate.now()` as default. [#12099](https://github.com/CesiumGS/cesium/pull/12099) - Exposes `ScreenSpaceCameraController.zoomFactor` to allow adjusting the zoom factor (speed). [#9145](https://github.com/CesiumGS/cesium/pull/9145) +- Added `CallbackPositionProperty` to allow lazy entity position evaluation. ##### Fixes :wrench: diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 5ffba76b8eb..bbdc1f9c8ac 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -404,4 +404,5 @@ See [CONTRIBUTING.md](CONTRIBUTING.md) for details on how to contribute to Cesiu - [Vladislav Yunev](https://github.com/YunVlad) - [Levi Montgomery](https://github.com/Levi-Montgomery) - [Brandon Berisford](https://github.com/BeyondBelief96) -- [Adam Wirth](https://https://github.com/adamwirth) +- [Adam Wirth](https://github.com/adamwirth) +- [Jérôme Fayot](https://github.com/jfayot) diff --git a/packages/engine/Source/DataSources/CallbackPositionProperty.js b/packages/engine/Source/DataSources/CallbackPositionProperty.js new file mode 100644 index 00000000000..61909f99566 --- /dev/null +++ b/packages/engine/Source/DataSources/CallbackPositionProperty.js @@ -0,0 +1,173 @@ +import defaultValue from "../Core/defaultValue.js"; +import defined from "../Core/defined.js"; +import DeveloperError from "../Core/DeveloperError.js"; +import Event from "../Core/Event.js"; +import JulianDate from "../Core/JulianDate.js"; +import ReferenceFrame from "../Core/ReferenceFrame.js"; +import PositionProperty from "./PositionProperty.js"; + +/** + * A {@link PositionProperty} whose value is lazily evaluated by a callback function. + * + * @alias CallbackPositionProperty + * @constructor + * + * @param {CallbackPositionProperty.Callback} callback The function to be called when the position property is evaluated. + * @param {boolean} isConstant true when the callback function returns the same value every time, false if the value will change. + * @param {ReferenceFrame} [referenceFrame=ReferenceFrame.FIXED] The reference frame in which the position is defined. + * + * @demo {@link https://sandcastle.cesium.com/index.html?src=Callback%20Position%20Property.html|Cesium Sandcastle Callback Position Property Demo} + */ +function CallbackPositionProperty(callback, isConstant, referenceFrame) { + this._callback = undefined; + this._isConstant = undefined; + this._referenceFrame = defaultValue(referenceFrame, ReferenceFrame.FIXED); + this._definitionChanged = new Event(); + this.setCallback(callback, isConstant); +} + +Object.defineProperties(CallbackPositionProperty.prototype, { + /** + * Gets a value indicating if this property is constant. + * @memberof CallbackPositionProperty.prototype + * + * @type {boolean} + * @readonly + */ + isConstant: { + get: function () { + return this._isConstant; + }, + }, + /** + * Gets the event that is raised whenever the definition of this property changes. + * The definition is considered to have changed if a call to getValue would return + * a different result for the same time. + * @memberof CallbackPositionProperty.prototype + * + * @type {Event} + * @readonly + */ + definitionChanged: { + get: function () { + return this._definitionChanged; + }, + }, + /** + * Gets the reference frame in which the position is defined. + * @memberof CallbackPositionProperty.prototype + * @type {ReferenceFrame} + * @default ReferenceFrame.FIXED; + */ + referenceFrame: { + get: function () { + return this._referenceFrame; + }, + }, +}); + +const timeScratch = new JulianDate(); + +/** + * Gets the value of the property at the provided time in the fixed frame. + * + * @param {JulianDate} [time=JulianDate.now()] The time for which to retrieve the value. If omitted, the current system time is used. + * @param {Cartesian3} [result] The object to store the value into, if omitted, a new instance is created and returned. + * @returns {Cartesian3 | undefined} The modified result parameter or a new instance if the result parameter was not supplied. + */ +CallbackPositionProperty.prototype.getValue = function (time, result) { + if (!defined(time)) { + time = JulianDate.now(timeScratch); + } + return this.getValueInReferenceFrame(time, ReferenceFrame.FIXED, result); +}; + +/** + * Sets the callback to be used. + * + * @param {CallbackPositionProperty.Callback} callback The function to be called when the property is evaluated. + * @param {boolean} isConstant true when the callback function returns the same value every time, false if the value will change. + */ +CallbackPositionProperty.prototype.setCallback = function ( + callback, + isConstant +) { + //>>includeStart('debug', pragmas.debug); + if (!defined(callback)) { + throw new DeveloperError("callback is required."); + } + if (!defined(isConstant)) { + throw new DeveloperError("isConstant is required."); + } + //>>includeEnd('debug'); + + const changed = + this._callback !== callback || this._isConstant !== isConstant; + + this._callback = callback; + this._isConstant = isConstant; + + if (changed) { + this._definitionChanged.raiseEvent(this); + } +}; + +/** + * Gets the value of the property at the provided time and in the provided reference frame. + * + * @param {JulianDate} time The time for which to retrieve the value. + * @param {ReferenceFrame} referenceFrame The desired referenceFrame of the result. + * @param {Cartesian3} [result] The object to store the value into, if omitted, a new instance is created and returned. + * @returns {Cartesian3 | undefined} The modified result parameter or a new instance if the result parameter was not supplied. + */ +CallbackPositionProperty.prototype.getValueInReferenceFrame = function ( + time, + referenceFrame, + result +) { + //>>includeStart('debug', pragmas.debug); + if (!defined(time)) { + throw new DeveloperError("time is required."); + } + if (!defined(referenceFrame)) { + throw new DeveloperError("referenceFrame is required."); + } + //>>includeEnd('debug'); + + const value = this._callback(time, result); + + return PositionProperty.convertToReferenceFrame( + time, + value, + this._referenceFrame, + referenceFrame, + result + ); +}; + +/** + * Compares this property to the provided property and returns + * true if they are equal, false otherwise. + * + * @param {Property} [other] The other property. + * @returns {boolean} true if left and right are equal, false otherwise. + */ +CallbackPositionProperty.prototype.equals = function (other) { + return ( + this === other || + (other instanceof CallbackPositionProperty && + this._callback === other._callback && + this._isConstant === other._isConstant && + this._referenceFrame === other._referenceFrame) + ); +}; + +/** + * A function that returns the value of the position property. + * @callback CallbackPositionProperty.Callback + * + * @param {JulianDate} [time=JulianDate.now()] The time for which to retrieve the value. If omitted, the current system time is used. + * @param {Cartesian3} [result] The object to store the value into. If omitted, the function must create and return a new instance. + * @returns {Cartesian3 | undefined} The modified result parameter, or a new instance if the result parameter was not supplied or is unsupported. + */ +export default CallbackPositionProperty; diff --git a/packages/engine/Source/DataSources/PathVisualizer.js b/packages/engine/Source/DataSources/PathVisualizer.js index 8ae9a415fff..6c99fc36815 100644 --- a/packages/engine/Source/DataSources/PathVisualizer.js +++ b/packages/engine/Source/DataSources/PathVisualizer.js @@ -11,6 +11,7 @@ import TimeInterval from "../Core/TimeInterval.js"; import Transforms from "../Core/Transforms.js"; import PolylineCollection from "../Scene/PolylineCollection.js"; import SceneMode from "../Scene/SceneMode.js"; +import CallbackPositionProperty from "./CallbackPositionProperty.js"; import CompositePositionProperty from "./CompositePositionProperty.js"; import ConstantPositionProperty from "./ConstantPositionProperty.js"; import MaterialProperty from "./MaterialProperty.js"; @@ -135,6 +136,58 @@ function subSampleSampledProperty( return r; } +function subSampleCallbackPositionProperty( + property, + start, + stop, + updateTime, + referenceFrame, + maximumStep, + startingIndex, + result +) { + let tmp; + let i = 0; + let index = startingIndex; + let time = start; + let steppedOnNow = + !defined(updateTime) || + JulianDate.lessThanOrEquals(updateTime, start) || + JulianDate.greaterThanOrEquals(updateTime, stop); + while (JulianDate.lessThan(time, stop)) { + if (!steppedOnNow && JulianDate.greaterThanOrEquals(time, updateTime)) { + steppedOnNow = true; + tmp = property.getValueInReferenceFrame( + updateTime, + referenceFrame, + result[index] + ); + if (defined(tmp)) { + result[index] = tmp; + index++; + } + } + tmp = property.getValueInReferenceFrame( + time, + referenceFrame, + result[index] + ); + if (defined(tmp)) { + result[index] = tmp; + index++; + } + i++; + time = JulianDate.addSeconds(start, maximumStep * i, new JulianDate()); + } + //Always sample stop. + tmp = property.getValueInReferenceFrame(stop, referenceFrame, result[index]); + if (defined(tmp)) { + result[index] = tmp; + index++; + } + return index; +} + function subSampleGenericProperty( property, start, @@ -339,6 +392,17 @@ function reallySubSample( index, result ); + } else if (property instanceof CallbackPositionProperty) { + index = subSampleCallbackPositionProperty( + property, + start, + stop, + updateTime, + referenceFrame, + maximumStep, + index, + result + ); } else if (property instanceof CompositePositionProperty) { index = subSampleCompositeProperty( property, diff --git a/packages/engine/Source/DataSources/PositionProperty.js b/packages/engine/Source/DataSources/PositionProperty.js index 66a9c384b67..17bce66ed19 100644 --- a/packages/engine/Source/DataSources/PositionProperty.js +++ b/packages/engine/Source/DataSources/PositionProperty.js @@ -14,6 +14,7 @@ import Transforms from "../Core/Transforms.js"; * @constructor * @abstract * + * @see CallbackPositionProperty * @see CompositePositionProperty * @see ConstantPositionProperty * @see SampledPositionProperty diff --git a/packages/engine/Specs/DataSources/CallbackPositionPropertySpec.js b/packages/engine/Specs/DataSources/CallbackPositionPropertySpec.js new file mode 100644 index 00000000000..c9c2470f89a --- /dev/null +++ b/packages/engine/Specs/DataSources/CallbackPositionPropertySpec.js @@ -0,0 +1,196 @@ +import { + JulianDate, + CallbackPositionProperty, + Cartesian3, + PositionProperty, + ReferenceFrame, +} from "../../index.js"; + +describe("DataSources/CallbackPositionProperty", function () { + const time = JulianDate.now(); + + it("constructor throws with undefined isConstant", function () { + expect(function () { + return new CallbackPositionProperty(function () {}, undefined); + }).toThrowDeveloperError(); + }); + + it("constructor throws with undefined callback", function () { + expect(function () { + return new CallbackPositionProperty(undefined, true); + }).toThrowDeveloperError(); + }); + + it("constructor sets expected defaults", function () { + const callback = jasmine.createSpy("callback"); + let property = new CallbackPositionProperty(callback, true); + expect(property.referenceFrame).toBe(ReferenceFrame.FIXED); + + property = new CallbackPositionProperty( + callback, + true, + ReferenceFrame.INERTIAL + ); + expect(property.referenceFrame).toBe(ReferenceFrame.INERTIAL); + }); + + it("callback received proper parameters", function () { + const result = {}; + const callback = jasmine.createSpy("callback"); + const property = new CallbackPositionProperty(callback, true); + property.getValue(time, result); + expect(callback).toHaveBeenCalledWith(time, result); + }); + + it("getValue returns callback result", function () { + const value = new Cartesian3(1, 2, 3); + const callback = function (_time, result) { + return value.clone(result); + }; + const property = new CallbackPositionProperty(callback, true); + const result = property.getValue(time); + expect(result).not.toBe(value); + expect(result).toEqual(value); + + const value2 = new Cartesian3(); + expect(property.getValue(time, value2)).toBe(value2); + }); + + it("getValue returns in fixed frame", function () { + const valueInertial = new Cartesian3(1, 2, 3); + const valueFixed = PositionProperty.convertToReferenceFrame( + time, + valueInertial, + ReferenceFrame.INERTIAL, + ReferenceFrame.FIXED + ); + const callback = function (_time, result) { + return valueInertial.clone(result); + }; + const property = new CallbackPositionProperty( + callback, + true, + ReferenceFrame.INERTIAL + ); + + const result = property.getValue(time); + expect(result).toEqual(valueFixed); + }); + + it("getValue uses JulianDate.now() if time parameter is undefined", function () { + spyOn(JulianDate, "now").and.callThrough(); + + const value = new Cartesian3(1, 2, 3); + const callback = function (_time, result) { + return value.clone(result); + }; + const property = new CallbackPositionProperty(callback, true); + const actualResult = property.getValue(); + expect(JulianDate.now).toHaveBeenCalled(); + expect(actualResult).toEqual(value); + }); + + it("getValueInReferenceFrame works without a result parameter", function () { + const value = new Cartesian3(1, 2, 3); + const callback = function (_time, result) { + return value.clone(result); + }; + const property = new CallbackPositionProperty(callback, true); + + const result = property.getValueInReferenceFrame( + time, + ReferenceFrame.INERTIAL + ); + expect(result).not.toBe(value); + expect(result).toEqual( + PositionProperty.convertToReferenceFrame( + time, + value, + ReferenceFrame.FIXED, + ReferenceFrame.INERTIAL + ) + ); + }); + + it("getValueInReferenceFrame works with a result parameter", function () { + const value = new Cartesian3(1, 2, 3); + const callback = function (_time, result) { + return value.clone(result); + }; + const property = new CallbackPositionProperty( + callback, + true, + ReferenceFrame.INERTIAL + ); + + const expected = new Cartesian3(); + const result = property.getValueInReferenceFrame( + time, + ReferenceFrame.FIXED, + expected + ); + expect(result).toBe(expected); + expect(expected).toEqual( + PositionProperty.convertToReferenceFrame( + time, + value, + ReferenceFrame.INERTIAL, + ReferenceFrame.FIXED + ) + ); + }); + + it("getValueInReferenceFrame throws with undefined time", function () { + const property = new CallbackPositionProperty(function () {}, true); + + expect(function () { + property.getValueInReferenceFrame(undefined, ReferenceFrame.FIXED); + }).toThrowDeveloperError(); + }); + + it("getValueInReferenceFrame throws with undefined reference frame", function () { + const property = new CallbackPositionProperty(function () {}, true); + + expect(function () { + property.getValueInReferenceFrame(time, undefined); + }).toThrowDeveloperError(); + }); + + it("isConstant returns correct value", function () { + const property = new CallbackPositionProperty(function () {}, true); + expect(property.isConstant).toBe(true); + property.setCallback(function () {}, false); + expect(property.isConstant).toBe(false); + }); + + it("setCallback raises definitionChanged event", function () { + const property = new CallbackPositionProperty(function () {}, true); + const listener = jasmine.createSpy("listener"); + property.definitionChanged.addEventListener(listener); + property.setCallback(function () {}, false); + expect(listener).toHaveBeenCalledWith(property); + }); + + it("equals works", function () { + const callback = function () {}; + const left = new CallbackPositionProperty(callback, true); + let right = new CallbackPositionProperty(callback, true); + + expect(left.equals(right)).toEqual(true); + + right.setCallback(callback, false); + expect(left.equals(right)).toEqual(false); + + right.setCallback(function () { + return undefined; + }, true); + expect(left.equals(right)).toEqual(false); + + right = new CallbackPositionProperty( + callback, + true, + ReferenceFrame.INERTIAL + ); + expect(left.equals(right)).toEqual(false); + }); +}); diff --git a/packages/engine/Specs/DataSources/ConstantPositionPropertySpec.js b/packages/engine/Specs/DataSources/ConstantPositionPropertySpec.js index 7c1442cdef9..0d4c734aeef 100644 --- a/packages/engine/Specs/DataSources/ConstantPositionPropertySpec.js +++ b/packages/engine/Specs/DataSources/ConstantPositionPropertySpec.js @@ -61,7 +61,7 @@ describe("DataSources/ConstantPositionProperty", function () { expect(property.getValue(time)).toBeUndefined(); }); - it("getValue work swith undefined inertial value", function () { + it("getValue works with undefined inertial value", function () { const property = new ConstantPositionProperty( undefined, ReferenceFrame.INERTIAL From 0477bd58bbc6ee5d1d91601bdf862ea7760d2f96 Mon Sep 17 00:00:00 2001 From: "jerome.fayot" Date: Thu, 29 Aug 2024 16:09:27 +0200 Subject: [PATCH 2/5] updated CHANGES.md --- CHANGES.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index ca4dd030145..12068d9f9d0 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -9,7 +9,7 @@ - Enable MSAA by default with 4 samples. To turn MSAA off set `scene.msaaSamples = 1` [#12158](https://github.com/CesiumGS/cesium/pull/12158) - Made the `time` parameter optional for `Property`, using `JulianDate.now()` as default. [#12099](https://github.com/CesiumGS/cesium/pull/12099) - Exposes `ScreenSpaceCameraController.zoomFactor` to allow adjusting the zoom factor (speed). [#9145](https://github.com/CesiumGS/cesium/pull/9145) -- Added `CallbackPositionProperty` to allow lazy entity position evaluation. +- Added `CallbackPositionProperty` to allow lazy entity position evaluation. [#12170](https://github.com/CesiumGS/cesium/pull/12170) ##### Fixes :wrench: From 0fa1e9dcb7deb42c0f538b54ce2a1cfe2ee0b1d6 Mon Sep 17 00:00:00 2001 From: "jerome.fayot" Date: Thu, 29 Aug 2024 16:56:30 +0200 Subject: [PATCH 3/5] fixed crash on sandcastle demo while morphing --- .../gallery/Callback Position Property.html | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Apps/Sandcastle/gallery/Callback Position Property.html b/Apps/Sandcastle/gallery/Callback Position Property.html index e95cd9e82db..ae11190b8ac 100644 --- a/Apps/Sandcastle/gallery/Callback Position Property.html +++ b/Apps/Sandcastle/gallery/Callback Position Property.html @@ -177,14 +177,26 @@ }); const camera = viewer.camera; + const scene = viewer.scene; const scratchPosition = new Cesium.Cartesian3(); const scratchOrientation = new Cesium.Quaternion(); const scratchTransform = new Cesium.Matrix4(); const offset = new Cesium.Cartesian3(-100, 0, 10); + let morphing = false; + scene.morphStart.addEventListener(function () { + morphing = true; + }); + scene.morphComplete.addEventListener(function () { + morphing = false; + }); + // Update camera to follow entity's position and orientation viewer.clock.onTick.addEventListener(function (clock) { + if (morphing) { + return; + } const time = clock.currentTime; const entityPosition = position.getValue(time, scratchPosition); const entityOrientation = orientation.getValue( From 533f2a2267c01a10634b8047f8e0d30fde5490a8 Mon Sep 17 00:00:00 2001 From: "jerome.fayot" Date: Thu, 29 Aug 2024 17:38:56 +0200 Subject: [PATCH 4/5] added PathVizualizer test case for callback position property --- .../Specs/DataSources/PathVisualizerSpec.js | 54 +++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/packages/engine/Specs/DataSources/PathVisualizerSpec.js b/packages/engine/Specs/DataSources/PathVisualizerSpec.js index c34f20ce89d..ce9ecfff278 100644 --- a/packages/engine/Specs/DataSources/PathVisualizerSpec.js +++ b/packages/engine/Specs/DataSources/PathVisualizerSpec.js @@ -16,6 +16,8 @@ import { PolylineOutlineMaterialProperty, ReferenceProperty, SampledPositionProperty, + CallbackPositionProperty, + LinearSpline, ScaledPositionProperty, TimeIntervalCollectionPositionProperty, SceneMode, @@ -733,6 +735,58 @@ describe( expect(result).toEqual([new Cartesian3(0, 0, 3)]); }); + it("subSample works for callback position properties", function () { + const t1 = new JulianDate(0, 0); + const t2 = new JulianDate(2, 0); + const updateTime = new JulianDate(1, 1); + const duration = JulianDate.secondsDifference(t2, t1); + const spline = new LinearSpline({ + times: [0, 1], + points: [new Cartesian3(0, 0, 0), new Cartesian3(0, 0, 1)], + }); + const callback = function (time, result) { + if (JulianDate.lessThan(time, t1) || JulianDate.greaterThan(time, t2)) { + return undefined; + } + if (result === undefined) { + result = new Cartesian3(); + } + const delta = JulianDate.secondsDifference(time, t1); + return spline.evaluate(delta / duration, result); + }; + + const property = new CallbackPositionProperty(callback, false); + + const referenceFrame = ReferenceFrame.FIXED; + const maximumStep = 43200; + const result = []; + PathVisualizer._subSample( + property, + t1, + t2, + updateTime, + referenceFrame, + maximumStep, + result + ); + expect(result).toEqual([ + property.getValue(t1), + property.getValue( + JulianDate.addSeconds(t1, maximumStep, new JulianDate()) + ), + property.getValue( + JulianDate.addSeconds(t1, maximumStep * 2, new JulianDate()) + ), + property.getValue(updateTime), + property.getValue( + JulianDate.addSeconds(t1, maximumStep * 3, new JulianDate()) + ), + property.getValue( + JulianDate.addSeconds(t1, maximumStep * 4, new JulianDate()) + ), + ]); + }); + function CustomPositionProperty(innerProperty) { this.SampledProperty = innerProperty; this.isConstant = innerProperty.isConstant; From 82381cda56cbf9f203b2ef3abd886067ee3355ab Mon Sep 17 00:00:00 2001 From: "jerome.fayot" Date: Tue, 10 Sep 2024 21:08:27 +0200 Subject: [PATCH 5/5] fix: changes following review --- .../gallery/Callback Position Property.html | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/Apps/Sandcastle/gallery/Callback Position Property.html b/Apps/Sandcastle/gallery/Callback Position Property.html index ae11190b8ac..19dab3dadca 100644 --- a/Apps/Sandcastle/gallery/Callback Position Property.html +++ b/Apps/Sandcastle/gallery/Callback Position Property.html @@ -9,7 +9,7 @@ /> Cesium Demo @@ -184,17 +184,9 @@ const scratchTransform = new Cesium.Matrix4(); const offset = new Cesium.Cartesian3(-100, 0, 10); - let morphing = false; - scene.morphStart.addEventListener(function () { - morphing = true; - }); - scene.morphComplete.addEventListener(function () { - morphing = false; - }); - // Update camera to follow entity's position and orientation viewer.clock.onTick.addEventListener(function (clock) { - if (morphing) { + if (scene.mode === Cesium.Scene.MORPHING) { return; } const time = clock.currentTime;