From f708c4cd2edd8b28684baf211b9fa15514320f1c Mon Sep 17 00:00:00 2001 From: Tom Boullay Date: Tue, 2 Jun 2026 16:33:39 +0200 Subject: [PATCH] chore(debug): tune physics test scene and drop noisy waypoint logs Lower grabbable spawn, expose GPS preview position/rotation as constants, fix physics spawn to use PLAYER_EYE_HEIGHT, and silence the console.log noise around waypoint loading in TestMap. Co-Authored-By: Claude Opus 4.7 (1M context) --- src/data/debug/testSceneConfig.ts | 10 +++++++++- src/data/player/playerConfig.ts | 6 +++++- src/data/world/mapLodConfig.ts | 1 - src/world/debug/TestMap.tsx | 25 ++++++++++--------------- 4 files changed, 24 insertions(+), 18 deletions(-) diff --git a/src/data/debug/testSceneConfig.ts b/src/data/debug/testSceneConfig.ts index 2d7f49b..617fb3c 100644 --- a/src/data/debug/testSceneConfig.ts +++ b/src/data/debug/testSceneConfig.ts @@ -1,13 +1,15 @@ import type { Vector3Tuple } from "@/types/three/three"; import type { RepairMissionId } from "@/types/gameplay/repairMission"; +const DEG_TO_RAD = Math.PI / 180; + export const TEST_SCENE_FLOOR_POSITION: Vector3Tuple = [0, -0.5, 0]; export const TEST_SCENE_FLOOR_SIZE: Vector3Tuple = [200, 1, 200]; export const TEST_SCENE_FLOOR_COLLIDER_HALF_EXTENTS: Vector3Tuple = [ 100, 0.5, 100, ]; -export const TEST_SCENE_GRABBABLE_POSITION: Vector3Tuple = [0, 1, -3]; +export const TEST_SCENE_GRABBABLE_POSITION: Vector3Tuple = [0, 0.25, -3]; export const TEST_SCENE_GRABBABLE_BOX_SIZE: Vector3Tuple = [0.5, 0.5, 0.5]; export const TEST_SCENE_GRABBABLE_COLOR = "#e07b39"; export const TEST_SCENE_GRABBABLE_ROUGHNESS = 0.6; @@ -23,6 +25,12 @@ export const TEST_SCENE_TRIGGER_METALNESS = 0.5; export const TEST_SCENE_REPAIR_ZONE_MARKER_RADIUS = 1.65; export const TEST_SCENE_REPAIR_ZONE_MARKER_TUBE_RADIUS = 0.045; +export const TEST_SCENE_GPS_PREVIEW_POSITION: Vector3Tuple = [0, 5, -4.8]; +export const TEST_SCENE_GPS_PREVIEW_ROTATION: Vector3Tuple = [ + -33 * DEG_TO_RAD, + 0, + 0, +]; export const GAME_REPAIR_ZONES = [ { diff --git a/src/data/player/playerConfig.ts b/src/data/player/playerConfig.ts index 700d6d5..f2c556d 100644 --- a/src/data/player/playerConfig.ts +++ b/src/data/player/playerConfig.ts @@ -20,4 +20,8 @@ export const PLAYER_SPAWN_POSITION_GAME: Vector3Tuple = [ LA_FABRIK_PLAYER_SPAWN[1], LA_FABRIK_PLAYER_SPAWN[2] - 1, ]; -export const PLAYER_SPAWN_POSITION_PHYSICS: Vector3Tuple = [0, 3, 0]; +export const PLAYER_SPAWN_POSITION_PHYSICS: Vector3Tuple = [ + 0, + PLAYER_EYE_HEIGHT, + 0, +]; diff --git a/src/data/world/mapLodConfig.ts b/src/data/world/mapLodConfig.ts index b1e1b71..91ff213 100644 --- a/src/data/world/mapLodConfig.ts +++ b/src/data/world/mapLodConfig.ts @@ -24,7 +24,6 @@ export function getMapLodModelPath(modelName: string): string | null { ); } - export const MAP_LOD_SCALE_MULTIPLIERS = { sapin: 0.35, buisson: 0.7, diff --git a/src/world/debug/TestMap.tsx b/src/world/debug/TestMap.tsx index 0056b21..e1d74b9 100644 --- a/src/world/debug/TestMap.tsx +++ b/src/world/debug/TestMap.tsx @@ -17,6 +17,8 @@ import { TEST_SCENE_GRABBABLE_METALNESS, TEST_SCENE_GRABBABLE_POSITION, TEST_SCENE_GRABBABLE_ROUGHNESS, + TEST_SCENE_GPS_PREVIEW_POSITION, + TEST_SCENE_GPS_PREVIEW_ROTATION, GAME_REPAIR_ZONES, TEST_SCENE_REPAIR_ZONE_MARKER_RADIUS, TEST_SCENE_REPAIR_ZONE_MARKER_TUBE_RADIUS, @@ -110,24 +112,17 @@ export function TestMap({ onOctreeReady }: TestMapProps): React.JSX.Element { try { const parsed = JSON.parse(saved); if (Array.isArray(parsed) && parsed.length > 0) { - console.log( - `[TestMap] ${parsed.length} waypoints chargés depuis localStorage.`, - ); // Schedule state update to avoid synchronous setState in effect queueMicrotask(() => { if (!cancelled) setWaypoints(parsed); }); return; } - } catch (e) { - console.error("Failed to parse local storage waypoints", e); + } catch { + // Ignore parse errors — fall through to fetch fallback } } - // 2. Try public/roadNetwork.json - console.log( - "[TestMap] Tentative de chargement depuis /roadNetwork.json...", - ); fetch("/roadNetwork.json") .then((res) => { if (res.ok) return res.json(); @@ -136,14 +131,11 @@ export function TestMap({ onOctreeReady }: TestMapProps): React.JSX.Element { .then((data) => { if (cancelled) return; if (Array.isArray(data)) { - console.log( - `[TestMap] ${data.length} waypoints chargés depuis /roadNetwork.json.`, - ); setWaypoints(data); } }) - .catch((err) => { - console.log("[TestMap] Aucun point d'A* trouvé par défaut.", err); + .catch(() => { + // No A* waypoints available — silent fallback }); return () => { @@ -253,7 +245,10 @@ export function TestMap({ onOctreeReady }: TestMapProps): React.JSX.Element { {/* Dynamic Futuristic 3D GPS Dashboard Preview */} - + {/* Futuristic glowing screen frame (commented out to show true 3D transparency!) */} {/*