reveal icon indicating copy to clipboard operation
reveal copied to clipboard

fix(viewer): add the rotation with the target when the camera state has both in flexible camera manager

Open danpriori opened this issue 11 months ago • 1 comments

Type of change

Bug

Jira ticket :blue_book:

https://cognitedata.atlassian.net/browse/BND3D-5617 https://cognitedata.atlassian.net/browse/BND3D-5501

Description :pencil:

This fix uses the flexible camera's camera rotation state when it has both rotation and target defined in that state, whereas the target is a visual marker that may be off the direction of the Flexible Camera.

How has this been tested? :mag:

Tested in cog-3d and cog-demo scenes and 3d models with Orbit and Fly modes. Tested also in the same scene reported in the tickets. Tested in Windows browsers (Chrome and Firefox).

Test instructions :information_source:

  1. Go to the cog-demo project /Browser 3D/ select a scene
  2. In Orbit mode, mark the pivot point and move the camera position and its angle.
  3. Copy the URL, open a new tab and paste the url in the new tab.
  4. Observe
  5. Try the same steps above in Fly Mode.
  6. Observe.

camera-copy-url-state.webm

Checklist :ballot_box_with_check:

  • [X] I am happy with this implementation.
  • [X] I have performed a self-review of my own code.
  • [ ] I have added unit and visuals tests to prove that my feature works to the best of my ability.
  • [ ] I have added documentation to new and changed elements; both public and internally shared ones
  • [X] I have refactored the code for testability, readability and extendibility to the best of my ability.
  • [X] I have listed the JIRA tasks covering remaining work or tech debt related to this PR in the description.

danpriori avatar Apr 28 '25 14:04 danpriori

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 54.69%. Comparing base (0481433) to head (83e732d). Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5118      +/-   ##
==========================================
- Coverage   55.87%   54.69%   -1.18%     
==========================================
  Files        1124     1124              
  Lines       81630    81441     -189     
  Branches     5882     5564     -318     
==========================================
- Hits        45608    44545    -1063     
- Misses      35686    36551     +865     
- Partials      336      345       +9     
Files with missing lines Coverage Δ
...mera-manager/src/Flexible/FlexibleCameraManager.ts 46.42% <100.00%> (+9.18%) :arrow_up:

... and 58 files with indirect coverage changes

:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • :package: JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

codecov[bot] avatar Apr 28 '25 14:04 codecov[bot]