-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Particle System Sandcastle ES6 Update #10045
Conversation
Thanks for the pull request @srothst1!
Reviewers, don't forget to make sure that:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @srothst1! I have a few comments.
const snowUpdate = function (particle, dt) { | ||
let snowGravityScratch = new Cesium.Cartesian3(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the intention of scoping the variable to the block where it's needed, but this was scoped a level up on purpose. See the section on scratch variables in the Coding Guide.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice catch 👍
Co-authored-by: Gabby Getz <gabby@cesium.com>
Hi @ggetz! Thank you very much for the feedback. I just added various commits and comments that address your suggestions. |
Awesome, thanks @srothst1 ! |
Fixes #10038
The goal of this pull request is to re-work the Particle System Weather sandcastle demo such that it is functional when the
prefer-const
ES6 rule is enabled.My initial commits have made the following changes:
/* eslint-disable prefer-const */
snowGravityScratch
andrainGravityScratch
are declared.snowSystem
andrainSystem
variables.snowSystem
and therainSystem
objects were added to the scene as primitives. Their visibility was toggled using theshow
. I suspect that this may have caused performance issues. I added a commit that ensures that only the necessary primitives are kept in the scene.I am now able to run the Particle System Weather demo locally without the line:
/* eslint-disable prefer-const */
It has been mentioned various times that the current code is not well structured. As seen above, I made various edits. The biggest thing that stood out to me was how primitives were handled. However, if there is anything specific that still needs to be reworked, I would be happy to take a look at it.