diff --git a/docs/technical/architecture.md b/docs/technical/architecture.md index 61ec7b2..f502ff1 100644 --- a/docs/technical/architecture.md +++ b/docs/technical/architecture.md @@ -57,7 +57,7 @@ This document describes the code that exists today in the repository. ## Map Data - `public/map.json` is expected to be a `MapNode[]`. -- Each map node `name` maps to `public/models/{name}/model.gltf`. +- Each map node `name` maps to `public/models/{name}/model.glb` when available, with `public/models/{name}/model.gltf` kept as fallback. - The editor renders a fallback cube for missing models. - The game scene filters out nodes whose model cannot be resolved. diff --git a/docs/technical/editor.md b/docs/technical/editor.md index fd0e8cb..c927047 100644 --- a/docs/technical/editor.md +++ b/docs/technical/editor.md @@ -57,7 +57,7 @@ src/ `src/controls/editor/FlyController.tsx` provides editor movement controls for player-style navigation. -`src/utils/loadMapSceneData.ts` is shared by the game map and editor. It loads `/map.json` and resolves available `public/models/{name}/model.gltf` files. +`src/utils/loadMapSceneData.ts` is shared by the game map and editor. It loads `/map.json` and resolves available `public/models/{name}/model.glb` files first, then falls back to `public/models/{name}/model.gltf`. `src/utils/editor/loadEditorScene.ts` contains editor-only upload handling for user-selected folders. @@ -96,10 +96,10 @@ public/ ├── map.json └── models/ └── pylone/ - └── model.gltf + └── model.glb ``` -If a model is missing, the editor renders a fallback cube so the node can still be selected and transformed. +If `model.glb` and `model.gltf` are both missing, the editor renders a fallback cube so the node can still be selected and transformed. ## Editor Flow diff --git a/docs/user/editor.md b/docs/user/editor.md index 1c92b74..d98ba2a 100644 --- a/docs/user/editor.md +++ b/docs/user/editor.md @@ -9,7 +9,7 @@ Use the editor when you need to move, rotate, or scale existing map objects with The editor reads the same map data as the runtime scene: - `public/map.json` contains the object list. -- `public/models/{name}/model.gltf` contains the matching 3D model for each object name. +- `public/models/{name}/model.glb` contains the matching 3D model for each object name. `model.gltf` is still supported as a fallback during migration. - Missing models are displayed as gray fallback cubes, so incomplete maps remain editable. ## Map Node Format diff --git a/docs/user/features.md b/docs/user/features.md index a04fb80..ddf5212 100644 --- a/docs/user/features.md +++ b/docs/user/features.md @@ -5,7 +5,7 @@ This document lists features that are implemented in the current codebase. ## Scene - Fullscreen React Three Fiber scene -- Main map scene loaded from `public/map.json` and matching `public/models/{name}/model.gltf` assets +- 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 - Ambient and directional lighting - Environment background setup @@ -43,7 +43,7 @@ This document lists features that are implemented in the current codebase. - `/editor` route for inspecting and editing `public/map.json` - Automatic loading of `public/map.json` when available - Folder upload fallback when `map.json` is missing -- Rendering of available `public/models/{name}/model.gltf` assets +- Rendering of available `public/models/{name}/model.glb` or `model.gltf` assets - Fallback cubes for nodes whose model is missing - Object selection by click - Transform modes for translate, rotate, and scale diff --git a/src/data/docs/docsTranslations.ts b/src/data/docs/docsTranslations.ts index 82d45ec..91a3f4f 100644 --- a/src/data/docs/docsTranslations.ts +++ b/src/data/docs/docsTranslations.ts @@ -214,7 +214,7 @@ Ce document liste les fonctionnalités présentes dans le code actuel. ## Scène - Scène React Three Fiber plein écran -- Carte principale chargée depuis \`public/models/map/model.gltf\` +- Carte principale chargée depuis \`public/models/{name}/model.glb\`, avec fallback vers \`model.gltf\` - Scène de test physique debug sélectionnable depuis le panneau debug - Éclairage ambiant et directionnel - Configuration de l'environnement de fond @@ -268,7 +268,7 @@ L'éditeur travaille sur la liste de nodes stockée dans "/public/map.json". Chaque node décrit un objet de la scène : -- "name" : nom du dossier modèle dans "/public/models/{name}/model.gltf" +- "name" : nom du dossier modèle dans "/public/models/{name}/model.glb", avec fallback vers "model.gltf" - "type" : catégorie de l'objet - "position" : "[x, y, z]" - "rotation" : "[x, y, z]" diff --git a/src/pages/editor/page.tsx b/src/pages/editor/page.tsx index e06cc51..c60e93b 100644 --- a/src/pages/editor/page.tsx +++ b/src/pages/editor/page.tsx @@ -138,7 +138,7 @@ export function EditorPage(): React.JSX.Element {
public/ ├── map.json (à la racine) └── models/
- ├── arbre/ │ └── model.gltf ├── building/ │ └── model.gltf └──
+ ├── arbre/ │ └── model.glb ├── building/ │ └── model.gltf └──
...
diff --git a/src/utils/editor/loadEditorScene.ts b/src/utils/editor/loadEditorScene.ts
index 62e8e4c..e22b36f 100644
--- a/src/utils/editor/loadEditorScene.ts
+++ b/src/utils/editor/loadEditorScene.ts
@@ -21,9 +21,12 @@ export async function createSceneDataFromFiles(
const models = new Map