-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dynamic boxes don't track correctly #5164
Comments
I am hitting this in a use case of tracking a moving object with a "keepout box" around it. An ellipsoid works fine, but if I use a box the tracking doesn't work and the camera is pointed at the original entity position at T0. I would appreciate prioritizing this issue. |
Related to #6631
|
Also reported by @461255824 in #8800 See test case here: #8800 (comment) |
thank you! the project is amazing |
Reported again on the forum: https://community.cesium.com/t/problem-of-tracking-entity-with-dynamic-polygon-hierarchy/9809
|
A potential fix is to change the second argument in cesium/Source/Widgets/Viewer/Viewer.js Line 1820 in 81f1306
true , as mentioned in #9455:
Viewer.prototype._onTick = function (clock) {
var time = clock.currentTime;
var isUpdated = this._dataSourceDisplay.update(time);
if (this._allowDataSourcesToSuspendAnimation) {
this._clockViewModel.canAnimate = isUpdated;
}
var entityView = this._entityView;
if (defined(entityView)) {
var trackedEntity = this._trackedEntity;
var trackedState = this._dataSourceDisplay.getBoundingSphere(
trackedEntity,
// false,
true, //switch false to true
boundingSphereScratch
);
if (trackedState === BoundingSphereState.DONE) {
entityView.update(time, boundingSphereScratch);
}
}
... This sets This may not be the best fix since it could incorrectly return when the data is not ready yet. More here:
|
Reported in #10517 |
Noticed during testing of #5133.
Boxes with dynamic geometry don't track correctly when the clock is animating. You can pause the clock, and track such a box with the camera, and that works fine. But when the clock moves, the box flies away from the camera.
Note that boxes are believed to be representative of almost all "dynamic" geometry with the exception of ellipsoids in 3D mode. Ellipsoids in 3D mode are actually not "dynamic" in the normal Cesium sense of rebuilding vertex data every frame, instead they modify their matrices for better performance. Boxes could be made to do that too, but this issue is specifically to track geometry that must be rebuilt every frame, and dynamic boxes are currently a good test case for that.
This is a very old bug, dating back at least to the introduction of boxes themselves. The most recent version of Cesium that doesn't show this bug is 1.22, because there is no dynamic box:
Working, but no box: Cesium 1.22 test
Box present, tracking broken: Cesium 1.23 test
More recent, same behavior: Cesium 1.31 test
The text was updated successfully, but these errors were encountered: