Skip to content
This repository has been archived by the owner on Apr 25, 2023. It is now read-only.

feat: extend plugin API with camera control #311

Merged
merged 28 commits into from Sep 14, 2022

Conversation

airslice
Copy link
Contributor

@airslice airslice commented Sep 7, 2022

Overview

This is required for reearth/reearth#337

This PR extends plugin API with:

reearth.camera.enableScreenSpaceController
reearth.camera.lookHorizontal
reearth.camera.lookVertical
reearth.camera.moveForward
reearth.camera.moveBackward
reearth.camera.moveUp
reearth.camera.moveDown
reearth.camera.moveLeft
reearth.camera.moveRight
reearth.camera.moveOverTerrain (async)
reearth.camera.flyToGround (async)

What I've done

Implement these metheds on engine and expose them to plugin API.

What I haven't done

How I tested

  • Functionalities tested with plugin.

Screenshot

Which point I want you to review particularly

  • The naming of enableScreenSpaceController and disableScreenSpaceController seems too long but i didn't come out with any better naming for it.
  • The lookXxx and moveXxx methods also can be merged into one with another param to define the direction but it will lead to one more condition check in each call and i think it might be better to provide these metheds more directly like this. Is that okey?

Memo

@netlify
Copy link

netlify bot commented Sep 7, 2022

Deploy Preview for reearth-web ready!

Name Link
🔨 Latest commit 3bd66c7
🔍 Latest deploy log https://app.netlify.com/sites/reearth-web/deploys/632147cf89306b0008bdf98b
😎 Deploy Preview https://deploy-preview-311--reearth-web.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@codecov
Copy link

codecov bot commented Sep 7, 2022

Codecov Report

Merging #311 (3bd66c7) into main (dcdf938) will increase coverage by 0.32%.
The diff coverage is 49.16%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #311      +/-   ##
==========================================
+ Coverage   16.75%   17.07%   +0.32%     
==========================================
  Files         502      502              
  Lines       48751    49273     +522     
  Branches      524      550      +26     
==========================================
+ Hits         8168     8415     +247     
- Misses      40565    40840     +275     
  Partials       18       18              
Impacted Files Coverage Δ
src/components/molecules/Visualizer/Engine/ref.ts 0.00% <0.00%> (ø)
src/components/molecules/Visualizer/Plugin/api.ts 6.21% <0.00%> (-0.93%) ⬇️
...rc/components/molecules/Visualizer/Plugin/types.ts 0.00% <0.00%> (ø)
src/components/molecules/Visualizer/hooks.ts 0.00% <0.00%> (ø)
src/components/molecules/Visualizer/storybook.tsx 0.00% <0.00%> (ø)
...components/molecules/Visualizer/Plugin/context.tsx 30.94% <26.66%> (-0.74%) ⬇️
...molecules/Visualizer/Engine/Cesium/useEngineRef.ts 66.80% <67.53%> (+0.13%) ⬆️
...nents/molecules/Visualizer/Engine/Cesium/common.ts 41.25% <73.82%> (+10.87%) ⬆️
...les/Visualizer/Engine/Cesium/useEngineRef.test.tsx 99.73% <100.00%> (+0.06%) ⬆️

@airslice airslice marked this pull request as ready for review September 12, 2022 03:58
@airslice airslice changed the title feat: extend plugin API of camera feat: extend plugin API with camera control Sep 12, 2022
@airslice airslice merged commit c1190be into main Sep 14, 2022
@airslice airslice deleted the feat/plugin-api-extend-camera branch September 14, 2022 06:53
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
3 participants