add: physics in game scene

This commit is contained in:
Tom Boullay
2026-05-08 01:17:35 +01:00
parent 96796bca65
commit 861a369776
4 changed files with 28 additions and 1 deletions
+10
View File
@@ -15,10 +15,20 @@ This document describes the code that exists today in the repository.
- either the map scene or the debug physics test scene
- the player rig when the active camera mode is `player`
- `src/world/GameMap.tsx` loads map nodes from `public/map.json`, resolves available models, and builds the collision octree.
- `src/world/GameStageContent.tsx` is wrapped in Rapier `Physics` in the production game scene so stage gameplay objects can use physics without moving the map or player to Rapier.
- `src/world/debug/TestMap.tsx` provides a debug-oriented interaction and physics map.
- `src/world/player/Player.tsx` mounts the camera and controller.
- `src/world/player/PlayerController.tsx` owns pointer lock movement, jump handling, and interaction input.
## Physics Boundaries
The project currently uses two collision layers with separate responsibilities:
- `GameMap` builds an octree used by the player controller for map collision.
- `GameStageContent` is wrapped in Rapier `Physics` for gameplay objects such as repair triggers, cases, grabbables, and future mission-specific objects.
Keep the player and map octree outside the Rapier provider until there is a deliberate migration plan. This avoids mixing player movement rules with object physics before the gameplay systems need it.
## Interaction Model
- `src/managers/InteractionManager.ts` is the current interaction state source.