Commit Graph

318 Commits

Author SHA1 Message Date
3f02fc7ea5 Implement lightmap-based rendering for performant lighting illusion
Replace emissive-only rendering with diffuse + lightmap system to achieve realistic lighting appearance without dynamic light overhead.

- Create LightmapGenerator class with canvas-based radial gradient generation
- Generate one lightmap per color (16 total) using top-left directional light simulation
- Cache lightmaps in static Map for reuse across all instances
- Preload all lightmaps at toolbox initialization for instant availability
- Update buildColor() to use diffuseColor + lightmapTexture instead of emissiveColor
- Update buildMissingMaterial() to use lightmap-based rendering
- Enable lighting calculations (disableLighting = false) to apply lightmaps

Lightmap details:
- 512x512 resolution RGBA textures
- Radial gradient: center (color × 1.5), mid (base color), edge (color × 0.3)
- Simulates top-left key light with smooth falloff
- Total memory: ~16 MB for all lightmaps
- Zero per-frame performance cost

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-13 09:20:40 -06:00
100c5e612c Move exit XR button to toolbox class
Refactored exit XR button creation from rigplatform to toolbox for better organization and UI cohesion.

- Add setXR() methods to DiagramManager, DiagramMenuManager, and Toolbox to pass WebXRDefaultExperience after initialization
- Create setupXRButton() in Toolbox class that creates button when entering XR
- Position button at bottom-right of toolbox (x: 0.5, y: -0.35, z: 0)
- Use Y-axis rotation (Math.PI) for correct orientation within toolbox coordinate system
- Scale button to 0.2 for appropriate size
- Remove button creation code from rigplatform

Exit button now moves with toolbox and is logically grouped with other UI elements.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-13 06:57:35 -06:00
d59c7b6e6e Enable per-instance edge rendering for hover effects
Changed EdgesRenderer to work on individual instances instead of source mesh to prevent all instances from highlighting when one is hovered.

- Remove edgesShareWithInstances flag (was causing all instances to highlight)
- Enable/disable edges directly on hovered instance
- Adjust edge width to 0.2 and color to pure white for cleaner appearance
- Remove metadata tracking in favor of checking edgesRenderer directly

This ensures only the specific hovered entity shows visual feedback while maintaining haptic feedback for all interactions.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-13 05:49:54 -06:00
0ad61bdde9 Fix XR component positioning to appear in front of user
- Use camera.getDirection() instead of manual Euler angle calculation to properly account for camera transform hierarchy
- Negate forward offsets to position objects in -Z direction (user faces -Z by design)
- Replace expensive HighlightLayer hover effect with lightweight EdgesRenderer (20-50x faster)
- Add comprehensive debug logging for position calculations

The camera has a parent transform with 180° Y rotation, causing the user to face -Z in world space. Components now correctly position in front of the user when entering XR.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-12 22:41:51 -06:00
4a9d7acc41 Optimize connection raycasting with position caching
Performance improvements:
- Added Vector3 position caching for connection endpoints
- Only update connections when meshes actually move (>0.001 units)
- Use DistanceSquared for efficient movement detection
- Replace inefficient vector length comparison

Impact:
- Static connections: 0 raycasts/second (was ~20/sec per connection)
- With 10 connections: 90-99% reduction in raycast operations
- Eliminates unnecessary curve geometry recreation

Implementation:
- Added _lastFromPosition and _lastToPosition caching
- Created hasConnectionMoved() method with tolerance threshold
- Reset cache on mesh removal and initial setup
- Clean up cache in disposal method

This dramatically reduces CPU usage in VR with multiple connections.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-12 21:46:57 -06:00
6ad04bb21a Refactor config naming and upgrade dependencies
Config changes:
- Renamed gridSnap to locationSnap for clarity
- Fixed configMenu to reference correct property
- Added debug logging to setAppConfig

Code cleanup:
- Removed commented duplicate exitXR call

Dependencies:
- Upgraded @babylonjs packages from 7.21.5 to 8.16.2
- Upgraded @mantine packages from 7.12.0 to 7.17.8

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-12 21:36:56 -06:00
293c74d7c1 Remove debug console.log from render loop
Removed console.log() from connectionPreview render observer that was
executing every frame during connection dragging. This eliminates I/O
blocking and stringification overhead in the critical VR render path.

Performance: Quick win for VR framerate improvement.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-12 21:29:24 -06:00
6d2049e1f6 Convert to unlit rendering and fix connection update error
Lighting changes:
- Disabled HemisphericLight in customEnvironment
- Changed all materials from diffuse to emissive colors
- Added disableLighting=true to all StandardMaterials
- Updated toolbox colors, diagram entities, and spinner

Bug fix:
- Fixed "Cannot read properties of undefined (reading 'pickedMesh')" error
- Added defensive check in DiagramObject.updateConnection()
- Now validates hit array has at least 2 elements before accessing

Materials now render at full brightness with unlit/flat shading.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-12 21:16:29 -06:00
cf0f359921 Position UI components relative to camera on XR entry
When entering immersive mode, toolbox and input text view now position
themselves relative to the user's initial camera position:
- Toolbox: 0.5m ahead, 0.5m below, 0.2m to the left
- Input text view: 0.5m ahead, 0.5m below (centered)

Uses camera world Y position to ensure vertical offset is consistent
regardless of head pitch/tilt when entering XR.

Also added CLAUDE.md documentation for the codebase.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-12 20:22:29 -06:00
58668443c4 Fix initialization errors when navigating to db/public/local
- Fix null reference error in buildColor.ts by initializing metadata.tools array
- Add physics engine availability check in buildRig to prevent PhysicsAggregate creation before engine is ready
- Remove duplicate scene initialization by eliminating redundant initializeEngine() call
- These fixes resolve WebGL shader compilation errors and prevent app crashes

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-15 16:25:15 -05:00
9d5234b629 Added webxr exit button 2025-02-14 11:01:27 -06:00
5ce0c9ce4f Changed menu to be consistent between mini and main size. 2024-11-22 09:25:22 -05:00
8c04b40d03 Added Branding + Auth. 2024-08-30 14:57:29 -05:00
f2b9e78e45 Updated config page. 2024-08-30 12:43:19 -05:00
4e6c3a63d0 Updated config page. 2024-08-30 12:43:19 -05:00
e69d008bfa Added 404 handler, changed page db update. 2024-08-30 12:43:19 -05:00
5d3cad0def Reintegrated VR compnent. 2024-08-30 12:43:19 -05:00
4f39030ed4 Disabled service worker, enhanced management console. 2024-08-30 12:43:19 -05:00
2397ddcd4c Updated UI to use Mantine. 2024-08-30 12:43:19 -05:00
b9152678b8 Removed dead code. 2024-08-30 12:43:19 -05:00
a9c8d3dbad Removed dead code. 2024-08-30 12:43:19 -05:00
60758ed84d Removed dead code. 2024-08-30 12:43:19 -05:00
71da2dd6a2 chnaged preview to match current connection style. 2024-08-23 10:25:26 -05:00
17206abca7 Added target sphere to pick preview 2024-08-23 10:12:07 -05:00
263879d215 Refactored private variables rig platform. 2024-08-23 10:11:03 -05:00
4cb50e5c6a Fixed initial camera rotation when entering XR. 2024-08-23 09:35:28 -05:00
ba2d9a7886 Added Directional arrows to connectors. 2024-08-23 09:26:44 -05:00
83279fa5b0 Added highlighting. 2024-08-23 08:50:00 -05:00
b443e1854b Fixed animation direction for connections. 2024-08-22 19:14:44 -05:00
c00fc55462 Moved label for connections. 2024-08-22 18:27:46 -05:00
b198605643 CHanged connector style 2024-08-22 18:21:08 -05:00
2486107041 updated linting warnings, removed unused variables. 2024-08-03 19:16:32 -05:00
a07b53f2a7 refactored web interface, updated image update code. 2024-08-03 19:12:32 -05:00
1d6c82a16a Updated db create event detail 2024-07-17 15:57:03 -05:00
1de6270f79 updated encryption to only encrypt when password is set. 2024-07-17 15:29:57 -05:00
4fdcc9694d Changed labels to help with export to glb. 2024-06-18 09:12:10 -05:00
4c300dc73b reformatted tool arrangement. Added diffusetexture to label. Added exportable to object parents. 2024-06-17 14:17:45 -05:00
e0d85a6a3d Added stl person to toolbox. 2024-06-17 11:33:24 -05:00
d08e86e92f Added websocket presence. 2024-06-14 09:38:16 -05:00
648876c06b fixed some race conditions. 2024-06-11 16:16:57 -05:00
bb9c3ec396 updated security 2024-06-11 12:19:38 -05:00
dec0041c21 updated security 2024-06-11 12:17:28 -05:00
3d3f73c259 added row level AES encryption. 2024-06-10 15:52:45 -05:00
d6941fd1bf added view only flag. 2024-06-07 09:21:18 -05:00
4a95028fe8 performance optimization, reduced face counts. 2024-06-07 08:24:31 -05:00
ffe8f60f38 performance optimization, user manager + afterRender were slowing things down. 2024-06-06 19:44:16 -05:00
9e7833b149 added ground mesh try catch. 2024-06-06 10:33:59 -05:00
cb2675bf27 added prod sourcemaps. 2024-06-06 10:06:06 -05:00
724cd79ab3 Removed html renderer, too may problems. 2024-06-06 09:22:39 -05:00
f07ea11817 Stupid hack due to race condition with click menu. 2024-06-05 16:01:49 -05:00
7315e3397a Refactored some larger classses...added enhanced map capability. 2024-06-03 08:34:48 -05:00
7806760153 removed unnecessary parameter. 2024-06-01 09:35:55 -05:00
7561a06b69 Created new interactive scaling menu. 2024-06-01 09:28:21 -05:00
06333e9123 Refactored things to be closer together in domain. 2024-05-31 19:38:30 -05:00
d8d91dd688 Fix connecter and controller bug. 2024-05-31 14:14:28 -05:00
fbafd747d3 Fix duplicator functionality. 2024-05-30 11:29:07 -05:00
63d1e627ad Added more logging. 2024-05-30 10:23:51 -05:00
1a3e9b879e Added clickMenu cleanup when multiple clicks. 2024-05-30 10:14:42 -05:00
d0b08b72e2 made connections not grabbable. 2024-05-30 10:11:07 -05:00
f26aa01211 Added Orphan connection cleanup and logging. 2024-05-30 10:08:04 -05:00
6ec28efe78 Updated way that connections are previewed. 2024-05-30 09:22:32 -05:00
cdaff97614 small change to formatting/fixed problem with mesh removal removing shared materials. 2024-05-29 09:13:06 -05:00
e85adc1386 Updated basic grab/drop. 2024-05-28 15:33:44 -05:00
2872026ac9 Upated babylonjs version, added map, camera, camerawindow. 2024-05-21 06:34:48 -05:00
15fdb938ee Added SW cache clear mechanism. 2024-05-08 09:17:06 -05:00
bbe54dc3e3 Added background noise. Refactor customEnvironment.ts 2024-05-08 07:55:42 -05:00
01874b9e9e Slight simplification refactor (no functional change) 2024-05-07 19:40:16 -05:00
3ade3d4d6a Slight simplification refactor (no functional change) 2024-05-07 19:33:06 -05:00
d8cdb019fb moved scene inspector. 2024-05-04 17:06:29 -05:00
fd774c0be2 Fixed clickmenu positioning. 2024-05-03 15:10:16 -05:00
08569de94d Fixed left controller typo. 2024-05-02 05:49:14 -05:00
d864c2e562 Fixed left controller typo. 2024-05-01 13:38:04 -05:00
a016aa749b Fixed Circular Dependency. 2024-05-01 09:11:10 -05:00
b788b64df5 Fixed Circular Dependency. 2024-05-01 08:34:25 -05:00
1dd192cd4d added initial gltf test. 2024-04-30 06:48:37 -05:00
d82df88296 Added Image upload component. 2024-04-29 13:39:05 -05:00
eb4281ac30 Moved loggers out of global module scope. 2024-04-28 11:07:03 -05:00
e27a77d674 Moved loggers out of global module scope. 2024-04-28 09:11:19 -05:00
2f29b0a2de Moved loggers out of global module scope. 2024-04-28 09:03:20 -05:00
791481e564 Added Metadata sync for friendly name 2024-04-27 06:51:24 -05:00
0e4d815225 Added Metadata sync for friendly name 2024-04-27 06:50:04 -05:00
f479f6043f Added Metadata sync for friendly name 2024-04-26 07:05:46 -05:00
4db349581b Updated Tutorial. 2024-04-25 12:38:29 -05:00
d761a59d6d removed button help from controllers. 2024-04-24 14:27:05 -05:00
36e4b04957 updated menu positioning, added b-button to enable resetting positions. 2024-04-24 14:24:22 -05:00
48c0535c8f Tweak to allow localdb not to sync to cloud and generate unique IDs for databases. 2024-04-24 11:50:23 -05:00
cfe174d564 Introduction revamp. 2024-04-24 07:50:26 -05:00
fbc39f2103 Introduction revamp. 2024-04-24 07:19:15 -05:00
c81dd8c24a Added Diagram Menu Manager. 2024-04-23 10:38:29 -05:00
e30bca5090 Refactor digramManager observer mask, updated logger in controllerbase. 2024-04-23 09:10:26 -05:00
f9127df48a Fixed grid and rotation snapping to be more sensible. 2024-04-21 07:51:15 -05:00
81c61fc6f8 Fixed grid and rotation snapping to be more sensible. 2024-04-20 17:22:14 -05:00
4b06cb2679 Fixed grab and clone to replicate properly. Changed connection size to match size menu control. 2024-04-20 08:05:09 -05:00
b2c5c85d7e Updated click menu to use Html Button. Added Scale feature. 2024-04-20 06:56:42 -05:00
ea5b8789c0 Added babylon-html, updated db to save values correctly in local storage. 2024-04-19 10:36:35 -05:00
2387fe53ef Updated how labels and text meshes are created/updated. Removed duplicates. 2024-04-17 15:00:52 -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
8bb77873cc Refactored scene to use DefaultScene. 2024-04-16 13:29:42 -05:00
b8521be13e Refactored scene to use DefaultScene. 2024-04-16 13:23:58 -05:00
f7dd6840e7 Refactored scene to use DefaultScene. 2024-04-16 13:21:00 -05:00