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

Particle System Sandcastle ES6 Update #10045

Merged
merged 8 commits into from
Jan 28, 2022
Merged

Particle System Sandcastle ES6 Update #10045

merged 8 commits into from
Jan 28, 2022

Conversation

srothst1
Copy link
Contributor

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:

  • Removed the line disabling one of our global ES6 rules: /* eslint-disable prefer-const */
  • Updated where snowGravityScratch and rainGravityScratch are declared.
  • Removed the snowSystem and rainSystem variables.
  • In the original implementation, both the snowSystem and the rainSystem objects were added to the scene as primitives. Their visibility was toggled using the show. 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.

@cesium-concierge
Copy link

Thanks for the pull request @srothst1!

  • ✔️ Signed CLA found.
  • CHANGES.md was not updated.
    • If this change updates the public API in any way, please add a bullet point to CHANGES.md.
  • ❔ Unit tests were not updated.
    • Make sure you've updated tests to reflect your changes, added tests for any new code, and ran the code coverage tool.

Reviewers, don't forget to make sure that:

  • Cesium Viewer works.
  • Works in 2D/CV.
Copy link
Contributor

@ggetz ggetz left a 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.

Apps/Sandcastle/gallery/Particle System Weather.html Outdated Show resolved Hide resolved
const snowUpdate = function (particle, dt) {
let snowGravityScratch = new Cesium.Cartesian3();
Copy link
Contributor

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch 👍

@srothst1
Copy link
Contributor Author

Hi @ggetz! Thank you very much for the feedback. I just added various commits and comments that address your suggestions.

@ggetz
Copy link
Contributor

ggetz commented Jan 28, 2022

Awesome, thanks @srothst1 !

@ggetz ggetz merged commit a275c75 into main Jan 28, 2022
@ggetz ggetz deleted the particle-system-es6 branch January 28, 2022 15:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants