CesiumGS / cesium

An open-source JavaScript library for world-class 3D globes and maps :earth_americas:
https://cesium.com/cesiumjs/
Apache License 2.0
13.02k stars 3.51k forks source link

Entity - Clamp to 3D Tiles #12195

Open TrainedTrex opened 2 months ago

TrainedTrex commented 2 months ago

What happened?

Entity - Clamp to 3D Tiles w/ Google P3DT

When you are trying to clamp to 3D tiles, Google's P3DT will be ignored. If CLAMP_TO_GROUND is selected the entity will clamp to the Cesium Globe if present but this is probably an async thing.

It is a behavior I have only been able to recreate with Google P3DT. This sandcastle also supports this, as CLAMP_TO_GROUND and CLAMP_TO_3D_TILE work as expected there. If you look at this example (make sure line 10 is commented out), you will see that the cube is "floating" relative to P3DT if either CLAMP_TO_GROUND or CLAMP_TO_3D_TILE are being used. If you toggle the globe off, the cube will snap to the 3D Tiles "ground" after a few seconds if CLAMP_TO_GROUND is being used. If CLAMP_TO_3D_TILE is being used, it will stay "floating" regardless of if the globe is toggled on or off.

Reproduction steps

  1. Import Google P3DT
  2. Create entity and clamp to 3D Tiles
  3. entity will be at the "height" of the Cesium globe and not clamped to P3DT

Sandcastle example

https://sandcastle.cesium.com/#c=lVRtb9owEP4rFp+ClDqlKavaUrQWUDeJDgR00zamyiQHsebYyD5gdOp/nx3zlpZpmj+Affc898I9R6KkQbLksAJNboiEFWmB4Yucfi5swbiSFO+Wksi4BD2uhOT3WBKCPAdhLVdkyoSB0NmY5DlDruSh0SQg4UGl0OfJT9CHrgkz0GVr0G9dUZTCHLO+YBI6QvC5UTztTacG8IqcnJ1a0Ev1eizHMil6KLLYFnwvtHhad/FNZ0JNgJpMrSyiyFEwUa99Lz4huU1T0s8UKg1McIM8IXGbjLgA4xA+EbonoA3EVozj9vdKLAfhXqmZgHKMuD3ylMDVS0oV0rnmOUe+BENZmgab4B64zwkSOa733RVvvuEUHbgjWW6nMa54tB3U1jFXhvupbIptMY32xmRMp1rlbZhpABOc1M7OaFy7iOvvQnJ+Qevx5eV5LSS10+ou1kT9uiK7lO6kVgjS2PDmb/FvtWbr4Pt5SOKQ1H/sg7ljBQOaM7EnK6E0/drpdntfSsgM+CzDAUxBg0xgR/hQttNW9/ah/zTqPd0Peo+f2qUYUfTfUeL20+hjtzMMnWR8lBd32chvN1DUzIo47Wxn5cdwfaCvb0rlBBXBDEjr8a6zH3BiR6eZl3d5Dz8AS7mc9Tkm2YDJGQS+iI37gWFGUQ0siEkTXNbpblbHESe10z3kwsLdrSTMZ1vlSAW+/LBUWvWgm391bffTcm3VJACtla461Vij+xgymSbMoACn4JGa2aW5WyAqWXQ3rgzdqt67rd3I+PUeF8YgycAlr5Kb5laTRxZ+gypqt+mr15Ww0jC4FtDcDvQ9z+dKI1loEVAaIeRzYXVposnCUpEmxvjeCWlEh9RGypeEpzdH/idJIpgx1jNdCDHkz7aVZiOy+DdUoYoZ95agBVs7WFZrdr2RUtqI7PM4E5USE6ZfRf4D

Environment

Browser: Chrome Version 128.0.6613.138 CesiumJS Version: 1.121 Operating System: Windows