-
Notifications
You must be signed in to change notification settings - Fork 20
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
feat(react-components): Preserve camera pivot point on Reset to Home #4686
feat(react-components): Preserve camera pivot point on Reset to Home #4686
Conversation
|
||
// Keep the camera target (pivot) in the same position | ||
viewer.cameraManager.setCameraState({ | ||
target: initialCameraState.target |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
initialCameraState.target
value be at origin when the scene is loaded for the first time, it would set the pivot point to origin when scene loaded for the first time
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, that would be an issue if the models are really far away from origin
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Checking for camera being in origin in ea7034a
viewer.cameraManager.setCameraState({ position, target }); | ||
|
||
// Check if camera pivot point is in origin |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add TODO comment here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems like a good incremental improvement
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Type of change
Jira ticket 📘
BND3D-4470
Description 📝
Preserves the current pivot point when moving the camera to Scene Home position. Currently, when moving the camera to the Scene Home position, the pivot point can be hidden as it's very or in a spot which is not close to the geometry of the model(s). In the future, we should make the Scene store position, rotation and pivot point.
How has this been tested? 🔍
Have been tested in the storybook for SceneContainer
Test instructions ℹ️
Checklist ☑️