Commit Graph

27 Commits

Author SHA1 Message Date
e329b95f2f Fix AppConfig persistence and consolidate handle storage
AppConfig Persistence Fixes:
- Fix constructor to properly handle null localStorage values
- Add null check before JSON.parse to prevent errors
- Create fresh config copies with spread operator to avoid reference issues
- Add better error handling and logging for config loading
- Initialize handles array properly

React ConfigModal Improvements:
- Fix config initialization to get fresh values on render instead of stale module-level values
- Separate useEffect hooks for each config property (prevents unnecessary updates)
- Fix SegmentedControl string-to-number conversion (locationSnaps now use "0.01", "0.1" format)
- Enable/disable logic now properly sets values to 0 when disabled

Handle Storage Consolidation:
- Create dynamic HandleConfig type with Vec3 for serializable position/rotation/scale
- Add handles array to AppConfigType for flexible handle storage
- Replace individual localStorage keys with centralized AppConfig storage
- Add handle management methods: getHandleConfig, setHandleConfig, removeHandleConfig, getAllHandleConfigs
- Update Handle class to read from AppConfig instead of direct localStorage
- Update dropMesh to save handles via AppConfig using Vec3 serialization
- Convert between BabylonJS Vector3 and serializable Vec3 at conversion points

Benefits:
- Single source of truth for all configuration
- Proper localStorage persistence across page reloads
- Dynamic handle creation without code changes
- Type-safe configuration with proper JSON serialization
- Consolidated storage (one appConfig key instead of multiple handle-* keys)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-19 15:34:40 -06:00
aa0810be02 Refactor Handle class and fix VR positioning
Major improvements to Handle class architecture:
- Replace positional constructor parameters with options object pattern (HandleOptions interface)
- Add automatic platform parenting - handles now find and parent themselves to platform
- Rename idStored → hasStoredPosition for better clarity
- Remove unused staort() method
- Improve position/rotation persistence with better error handling
- Add comprehensive JSDoc documentation
- Use .parent instead of setParent() for proper local space coordinates

Update all Handle usage sites:
- Toolbox: Use new API with position (-.5, 1.5, .5) and zero rotation
- InputTextView: Use new API with position (0, 1.5, .5) and zero rotation
- VRConfigPanel: Use new API with position (.5, 1.5, .5) and zero rotation
- Remove manual platform parenting logic (61 lines of duplicated code removed)
- Remove local position offsets that were overriding handle positions

Fix VR entry positioning:
- Disable camera-relative positioning in groundMeshObserver
- Handles now use their configured defaults or saved localStorage positions
- Positions are now in platform local space as intended

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-19 13:28:48 -06:00
60758ed84d Removed dead code. 2024-08-30 12:43:19 -05:00
3d3f73c259 added row level AES encryption. 2024-06-10 15:52:45 -05:00
d8d91dd688 Fix connecter and controller bug. 2024-05-31 14:14:28 -05:00
2f29b0a2de Moved loggers out of global module scope. 2024-04-28 09:03:20 -05:00
36e4b04957 updated menu positioning, added b-button to enable resetting positions. 2024-04-24 14:24:22 -05:00
469d4a5116 DefaultScene static method to be upper case...added webGPU support (disabled as there appears to be a bug). 2024-04-17 08:18:35 -05:00
a1248a2e34 Refactored scene to use DefaultScene. 2024-04-16 11:14:32 -05:00
d7e812d253 Removed sounds, beginning to refactor how sound interactions are handled. 2024-04-16 10:03:57 -05:00
c6e52138b3 changed main menu order and behavior, updated text node handling, refactored logging from console.log. 2024-04-13 11:34:25 -05:00
159e687c19 Simplified interactions, changed menu interactions for changing entities. 2024-04-12 13:33:52 -05:00
cabc38ce09 Simplified interactions, changed menu interactions for changing entities. 2024-04-12 07:04:02 -05:00
727977d5c6 Simplified interactions, changed menu interactions for changing entities. 2024-04-10 16:36:36 -05:00
73dae9c1cd Re added quest link. 2024-04-02 14:19:27 -05:00
73a850613d Updated menu system to be more consistent. Change toolbox to fixed colors; 2024-03-08 10:41:18 -06:00
717a5c6151 cleaned up warnings. 2023-09-05 19:30:15 -05:00
4f23023428 Updated sounds on edit menu. 2023-08-26 09:48:12 -05:00
e43a9e9d41 Fixed up menu system. 2023-08-25 13:26:19 -05:00
f44b2129c8 decomposed functions. 2023-08-23 14:15:44 -05:00
c383b57cb4 Fixed problem with label editor. 2023-08-17 10:20:39 -05:00
201e19a3aa Removed static controller references. 2023-08-14 19:27:15 -05:00
5fbd8f5648 Cleanup 2023-08-03 11:39:02 -05:00
77f5a2543f Updated P2P code, moved some classes to increase modularity. 2023-08-03 11:36:30 -05:00
8412b6f378 Refactored physics to reduce duplicate code. 2023-08-01 13:53:55 -05:00
d87d8bace4 Refactored diagram manager and loggers. 2023-07-28 09:30:10 -05:00
c74dc62654 Updated text input to work on desktop Mac 2023-07-27 08:51:25 -05:00