Implement camera state persistence#392
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Bug: Camera Positioning and Event Listener Issues
The camera handling introduces several issues:
The saved camera position is restored twice, with the second restoration overriding the first, making it redundant. Additionally, the space.controls 'update' event listener is attached prematurely and never removed. This causes it to trigger during initial camera setup, saving incorrect intermediate states that overwrite the user's saved position. Furthermore, its continuous firing during camera movement leads to frequent, expensive localStorage writes, degrading performance and potentially causing memory leaks.
src/composables/usePointland.js#L26-L87
pointland/src/composables/usePointland.js
Lines 26 to 87 in 3526e06
BugBot free trial expires on June 13, 2025
You have used $0.00 of your $0.00 spend limit so far. Manage your spend limit in the Cursor dashboard.
Was this report helpful? Give feedback by reacting with 👍 or 👎
There was a problem hiding this comment.
Pull Request Overview
This PR implements camera state persistence by storing and restoring the camera's position and target using a localStorage-backed Vuex module. Key changes include:
- Introducing a new Vuex state for camera data and a mutation to update it.
- Restoring the camera state after the point cloud loads.
- Continuously updating camera state on control events.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/store/ls.js | Added camera state structure and setCamera mutation. |
| src/composables/usePointland.js | Integrated camera state restoration and update logic. |
|
Closing in favor of #514 which implements camera persistence for the updated React codebase. This PR was created for the old Nuxt2/Vue2 architecture. |
Summary
Testing
npm run lint(fails: Parsing error: Unexpected token <)https://chatgpt.com/codex/tasks/task_e_6844d54ed6b883279a4a925700324fa8