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

Fix dynamic partial ellipsoids #8277

Merged
merged 4 commits into from
Oct 15, 2019
Merged

Fix dynamic partial ellipsoids #8277

merged 4 commits into from
Oct 15, 2019

Conversation

hpinkos
Copy link
Contributor

@hpinkos hpinkos commented Oct 11, 2019

Fixes #8271

This was an oversight on my part when I merged the partial ellipsoid PR. We need to rebuild the ellipsoid geometry when the clock and cone values change for dynamic ellipsoids.

var viewer = new Cesium.Viewer('cesiumContainer', {
    shouldAnimate: true
});

var entity = viewer.entities.add({
    position: Cesium.Cartesian3.fromDegrees(-120.0, 40.0),
    ellipsoid : {
        radii : new Cesium.CallbackProperty(setRadii, false),
        maximumCone :new Cesium.CallbackProperty(setAngle, false),
        material : Cesium.Color.BLUE.withAlpha(0.3),
        outline : true
    }
});

function setRadii(time) {
    var radius = Math.abs(Math.cos(time.secondsOfDay)) * 100000 + 30000.0;
    return new Cesium.Cartesian3(radius, radius, radius);
}

function setAngle(time) {
    var angle = Math.abs(Math.sin(time.secondsOfDay)) * Math.PI;
    return angle;
}

viewer.zoomTo(viewer.entities);

@hpinkos hpinkos requested a review from OmarShehata October 11, 2019 20:18
@cesium-concierge
Copy link

Thanks for the pull request @hpinkos!

  • ✔️ 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.
  • Works (or fails gracefully) in IE11.

Copy link
Contributor

@OmarShehata OmarShehata left a comment

Choose a reason for hiding this comment

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

Thanks @hpinkos, this works well! There's just some whitespace issues. Feel free to merge after fixing that.

Source/DataSources/EllipsoidGeometryUpdater.js Outdated Show resolved Hide resolved
@hpinkos
Copy link
Contributor Author

hpinkos commented Oct 15, 2019

@OmarShehata ready

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 this pull request may close these issues.

EllipsoidGraphics.maximumCone cannot be dynamic
3 participants