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.
+2
View File
@@ -7,6 +7,7 @@ This document lists features that are implemented in the current codebase.
- Fullscreen React Three Fiber scene
- Main map scene loaded from `public/map.json` and matching `public/models/{name}/model.glb` or `model.gltf` assets
- Debug physics test scene selectable from the debug panel
- Rapier physics context available for production stage gameplay objects
- Ambient and directional lighting
- Environment background setup
@@ -23,6 +24,7 @@ This document lists features that are implemented in the current codebase.
- Focus detection by distance and raycast
- Trigger interactions activated with `E`
- Grab interactions activated with the primary mouse button
- Physics-backed gameplay objects can be mounted inside stage content without replacing player octree collision
- Interaction prompt shown for trigger interactions
## Audio