Skip to content
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

BillboardVisualizer.js: dynamic entity position becomes tied to static entity position #6813

Closed
smlawrence opened this issue Jul 18, 2018 · 2 comments · Fixed by #6815
Closed

Comments

@smlawrence
Copy link

smlawrence commented Jul 18, 2018

Reproduced: Sandcastle

https://github.com/AnalyticalGraphicsInc/cesium/blob/master/Source/DataSources/BillboardVisualizer.js

most recent commit: 337ad9d

line 47: var position = new Cartesian3();
...
line 115: position = Property.getValueOrUndefined(entity._position, time, position);

In the case of a CallbackProperty if the author of the callback returns a variable of non-local scope (to their function) then through subsequent loops of this update method the position of other billboard entities gets written back to that variable via this global variable.

In the Sandcastle example the dynamic entity is under the mouse as it moves and then gets set back to the position of the static entity on each render tick.

Suggestion, to clone it if it exists, otherwise preserve current behavior:

var tempPos = Property.getValueOrUndefined(entity._position, time, position);
if(tempPos) {
 Cesium.Cartesian3.clone(tempPos, position);
} else {
position = tempPos;
}
@hpinkos
Copy link
Contributor

hpinkos commented Jul 18, 2018

Thanks for the detailed bug report @smlawrence! This made it really easy to track down the problem.
I've submitted a bug fix here: #6815

@smlawrence
Copy link
Author

Thank you for looking into and working on that so quickly 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants