I’m going to inspect the project structure and key entry files so I can replace the app with a complete playable soft-body driving experience.
I’m going to inspect the current dependencies and base styles so I can add the right 3D/physics stack and wire the UI cleanly.
I’m going to look up the current OpenRouter chat completions and JSON output format so the auto-tuning integration uses the correct API shape instead of guessing.
I’m going to read the official OpenRouter API reference page to confirm the exact request fields I should send from the browser.
I’m going to install the 3D stack needed for the browser game: Three.js, React Three Fiber, and Drei.
I’m going to create the vehicle detection and OpenRouter tuning module that parses uploaded filenames, generates strong fallback physics presets, and optionally requests AI-tuned parameters as structured JSON.
I created the vehicle tuning module with filename parsing, category heuristics, safe fallback presets, and browser-side OpenRouter JSON integration.
I’m going to create the input hook that captures WASD/arrow controls, handbrake, camera switching, and reset-friendly live keyboard state for the driving loop.
I created the keyboard controls hook for throttle, brake, steering, handbrake, and boost input.
I’m going to create the core soft-body simulation module: map geometry, GLTF normalization, deformation cage generation, node-beam physics, permanent damage, mesh deformation, and gameplay telemetry.
I created the main simulation module with a deformable node-beam cage, mesh skinning, terrain and obstacle collisions, damage accumulation, and real-time telemetry.
I’m going to create the 3D game canvas that loads uploaded GLB/GLTF bundles, initializes the simulation, renders the deforming vehicle and map, updates the camera, and adds audio plus debug views.
I’m going to fix the OrbitControls typing in the canvas file so TypeScript can compile the scene cleanly.
I’m going to inspect the relevant section of the canvas file so I can remove the remaining type-only OrbitControls references.
I’m going to replace the remaining OrbitControls type annotations with a generic ref type so the canvas file compiles without the value/type conflict.
I’m going to remove the last OrbitControls type annotation from the camera helper signature.
I removed the remaining OrbitControls type conflict so the canvas helper uses a permissive ref type.
I’m going to replace the app entry with the full game shell: HUD, drag-and-drop uploader, OpenRouter controls, telemetry, parameter panels, and the fullscreen 3D canvas.
I replaced the app entry with the full HUD and interaction shell for uploading cars, tuning them with OpenRouter, and driving the soft-body vehicle in the 3D test map.
I’m going to upgrade the global styles so the game fills the screen cleanly and the HUD panels, inputs, and scroll areas look premium.
I updated the global CSS to support a fullscreen dark game canvas and a more polished HUD.
I’m going to update the document title so the app is presented as a soft-body crash driving game instead of the default template.
I updated the page title to match the game.
I’m going to add a README that explains setup, OpenRouter usage, supported car uploads, and the soft-body deformation pipeline step by step.
I added a README covering setup, uploads, OpenRouter tuning, and the soft-body pipeline in detail.
I’m going to run the production build now to surface any TypeScript or runtime integration issues and then fix them.
I’m going to tighten the mesh normalization logic so all uploaded meshes compute skinning influences from the final combined bounds, not partially accumulated bounds.
I’m going to convert the mesh normalization block to a two-pass process so skinning weights use the full final body bounds across all meshes.
I updated the simulation so uploaded meshes now compute deformation weights from the final combined vehicle bounds.
I’m going to clean up a small formatting typo in the README’s beam-generation section.
I fixed the beam-generation typo in the README.
I’m going to replace the internal Three.js clamp import with the public MathUtils export for cleaner, more stable code.
I switched the tuning module to use Three’s public MathUtils API instead of an internal path.
I’m going to run the build one more time after the cleanup fixes to confirm everything still compiles successfully.
Built the soft-body driving game and verified it compiles.
What I added:
- Replaced
src/App.tsx with a full HUD/game shell
- Added a fullscreen 3D scene with:
- GLB/GLTF drag-and-drop loading
- filename-based make/model/year detection
- OpenRouter-powered auto-tuning with fallback presets
- a playable driving model
- node-beam soft-body deformation
- permanent damage accumulation and beam breaking
- ramps, walls, props, chase/hood/orbit cameras
- debug nodes/beams, telemetry, and procedural audio
- Updated
index.html title to SoftBody Crash Lab
- Added a detailed
README.md with setup, OpenRouter instructions, upload guidance, and the soft-body pipeline explanation
Key files created/updated:
src/App.tsx
src/game/GameCanvas.tsx
src/game/simulation.ts
src/lib/vehicleTuning.ts
src/hooks/useDrivingControls.ts
src/index.css
README.md
index.html
Build status:
npm run build passed successfully
Note:
- This is implemented as a high-quality browser-friendly node-beam soft-body approximation rather than full Ammo soft-volume simulation, which keeps it playable and deformable in real time.
Files built: src/lib/vehicleTuning.ts, src/hooks/useDrivingControls.ts, src/game/simulation.ts, src/game/GameCanvas.tsx, src/App.tsx, src/index.css, index.html, README.md