standardize source naming conventions

This commit is contained in:
2026-04-28 14:46:27 +02:00
parent 7e99d455b4
commit e20ead88e1
19 changed files with 33 additions and 33 deletions
@@ -3,7 +3,7 @@ import { useFrame, useThree } from "@react-three/fiber";
import { RigidBody } from "@react-three/rapier"; import { RigidBody } from "@react-three/rapier";
import type { RapierRigidBody } from "@react-three/rapier"; import type { RapierRigidBody } from "@react-three/rapier";
import * as THREE from "three"; import * as THREE from "three";
import { InteractableObject } from "@/components/3d/InteractableObject"; import { InteractableObject } from "@/components/three/InteractableObject";
import { import {
GRAB_DEFAULT_COLLIDERS, GRAB_DEFAULT_COLLIDERS,
GRAB_DEFAULT_LABEL, GRAB_DEFAULT_LABEL,
@@ -21,7 +21,7 @@ import {
GRAB_THROW_BOOST_STEP, GRAB_THROW_BOOST_STEP,
} from "@/data/interaction/grabConfig"; } from "@/data/interaction/grabConfig";
import { useDebugFolder } from "@/hooks/debug/useDebugFolder"; import { useDebugFolder } from "@/hooks/debug/useDebugFolder";
import type { ColliderShape, Vector3Tuple } from "@/types/3d"; import type { ColliderShape, Vector3Tuple } from "@/types/three";
interface GrabbableObjectProps { interface GrabbableObjectProps {
position: Vector3Tuple; position: Vector3Tuple;
@@ -11,9 +11,9 @@ import {
} from "@/data/debug/debugConfig"; } from "@/data/debug/debugConfig";
import { Debug } from "@/utils/debug/Debug"; import { Debug } from "@/utils/debug/Debug";
import { useDebugFolder } from "@/hooks/debug/useDebugFolder"; import { useDebugFolder } from "@/hooks/debug/useDebugFolder";
import { InteractionManager } from "@/stateManager/InteractionManager"; import { InteractionManager } from "@/managers/InteractionManager";
import { INTERACTION_RADIUS } from "@/data/interaction/interactionConfig"; import { INTERACTION_RADIUS } from "@/data/interaction/interactionConfig";
import type { Vector3Tuple } from "@/types/3d"; import type { Vector3Tuple } from "@/types/three";
import type { InteractableHandle } from "@/types/interaction"; import type { InteractableHandle } from "@/types/interaction";
interface InteractableObjectBaseProps { interface InteractableObjectBaseProps {
@@ -1,15 +1,15 @@
import { useState } from "react"; import { useState } from "react";
import { useGLTF } from "@react-three/drei"; import { useGLTF } from "@react-three/drei";
import { RigidBody } from "@react-three/rapier"; import { RigidBody } from "@react-three/rapier";
import { InteractableObject } from "@/components/3d/InteractableObject"; import { InteractableObject } from "@/components/three/InteractableObject";
import { import {
TRIGGER_DEFAULT_COLLIDERS, TRIGGER_DEFAULT_COLLIDERS,
TRIGGER_DEFAULT_LABEL, TRIGGER_DEFAULT_LABEL,
TRIGGER_DEFAULT_SOUND_VOLUME, TRIGGER_DEFAULT_SOUND_VOLUME,
TRIGGER_DEFAULT_SPAWN_OFFSET, TRIGGER_DEFAULT_SPAWN_OFFSET,
} from "@/data/interaction/triggerConfig"; } from "@/data/interaction/triggerConfig";
import { AudioManager } from "@/stateManager/AudioManager"; import { AudioManager } from "@/managers/AudioManager";
import type { ColliderShape, Vector3Tuple } from "@/types/3d"; import type { ColliderShape, Vector3Tuple } from "@/types/three";
interface SpawnedModel { interface SpawnedModel {
id: number; id: number;
+1 -1
View File
@@ -1,4 +1,4 @@
import type { Vector3Tuple } from "@/types/3d"; import type { Vector3Tuple } from "@/types/three";
export const TEST_SCENE_FLOOR_POSITION: Vector3Tuple = [0, -0.5, 0]; 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_SIZE: Vector3Tuple = [200, 1, 200];
+7 -7
View File
@@ -61,7 +61,7 @@ la-fabrik/
│ ├── 3d/ # Éléments 3D réutilisables │ ├── 3d/ # Éléments 3D réutilisables
│ └── ui/ # Overlays HTML hors Canvas │ └── ui/ # Overlays HTML hors Canvas
├── stateManager/ # Logique, état et orchestration ├── managers/ # Logique, état et orchestration
├── hooks/ # Hooks React autour des managers ├── hooks/ # Hooks React autour des managers
├── data/ # Configuration statique ├── data/ # Configuration statique
├── shaders/ # Shaders GLSL ├── shaders/ # Shaders GLSL
@@ -99,21 +99,21 @@ Ce document décrit le code réellement présent aujourd'hui dans le dépôt.
- le rig joueur quand le mode caméra actif est \`player\` - le rig joueur quand le mode caméra actif est \`player\`
- \`src/world/Map.tsx\` charge le modèle principal de la carte et construit l'octree de collision. - \`src/world/Map.tsx\` charge le modèle principal de la carte et construit l'octree de collision.
- \`src/world/debug/TestScene.tsx\` fournit une scène orientée debug pour les interactions et la physique. - \`src/world/debug/TestScene.tsx\` fournit une scène orientée debug pour les interactions et la physique.
- \`src/world/player/PlayerComponent.tsx\` monte la caméra et le contrôleur. - \`src/world/player/Player.tsx\` monte la caméra et le contrôleur.
- \`src/world/player/PlayerController.tsx\` gère le mouvement pointer lock, le saut et les inputs d'interaction. - \`src/world/player/PlayerController.tsx\` gère le mouvement pointer lock, le saut et les inputs d'interaction.
## Modèle d'interaction ## Modèle d'interaction
- \`src/stateManager/InteractionManager.ts\` est la source d'état actuelle des interactions. - \`src/managers/InteractionManager.ts\` est la source d'état actuelle des interactions.
- \`src/components/3d/InteractableObject.tsx\` gère la détection de focus par distance et raycasting. - \`src/components/three/InteractableObject.tsx\` gère la détection de focus par distance et raycasting.
- \`src/components/3d/TriggerObject.tsx\` implémente les interactions de type trigger. - \`src/components/three/TriggerObject.tsx\` implémente les interactions de type trigger.
- \`src/components/3d/GrabbableObject.tsx\` implémente les interactions saisir / relâcher. - \`src/components/three/GrabbableObject.tsx\` implémente les interactions saisir / relâcher.
- \`src/hooks/useInteraction.ts\` expose un snapshot d'interaction à l'UI React. - \`src/hooks/useInteraction.ts\` expose un snapshot d'interaction à l'UI React.
- \`src/components/ui/InteractPrompt.tsx\` affiche le prompt \`E\` pour les interactions trigger. - \`src/components/ui/InteractPrompt.tsx\` affiche le prompt \`E\` pour les interactions trigger.
## Audio ## Audio
- \`src/stateManager/AudioManager.ts\` fournit actuellement une lecture de sons one-shot avec pool. - \`src/managers/AudioManager.ts\` fournit actuellement une lecture de sons one-shot avec pool.
- Les interactions trigger peuvent lancer directement un son via \`AudioManager\`. - Les interactions trigger peuvent lancer directement un son via \`AudioManager\`.
## Système debug ## Système debug
+1 -1
View File
@@ -1,4 +1,4 @@
import type { Vector3Tuple } from "@/types/3d"; import type { Vector3Tuple } from "@/types/three";
export const TRIGGER_DEFAULT_COLLIDERS = "ball"; export const TRIGGER_DEFAULT_COLLIDERS = "ball";
export const TRIGGER_DEFAULT_LABEL = "Interagir"; export const TRIGGER_DEFAULT_LABEL = "Interagir";
+1 -1
View File
@@ -1,4 +1,4 @@
import type { Vector3Tuple } from "@/types/3d"; import type { Vector3Tuple } from "@/types/three";
export const PLAYER_EYE_HEIGHT = 1.75; export const PLAYER_EYE_HEIGHT = 1.75;
export const PLAYER_CAPSULE_RADIUS = 0.35; export const PLAYER_CAPSULE_RADIUS = 0.35;
+1 -1
View File
@@ -1,5 +1,5 @@
import { useSyncExternalStore } from "react"; import { useSyncExternalStore } from "react";
import { InteractionManager } from "@/stateManager/InteractionManager"; import { InteractionManager } from "@/managers/InteractionManager";
import type { InteractionSnapshot } from "@/types/interaction"; import type { InteractionSnapshot } from "@/types/interaction";
const manager = InteractionManager.getInstance(); const manager = InteractionManager.getInstance();
+1 -1
View File
@@ -2,7 +2,7 @@ import { useEffect, useRef } from "react";
import type { RefObject } from "react"; import type { RefObject } from "react";
import type { Object3D } from "three"; import type { Object3D } from "three";
import { Octree } from "three/addons/math/Octree.js"; import { Octree } from "three/addons/math/Octree.js";
import type { OctreeReadyHandler } from "@/types/3d"; import type { OctreeReadyHandler } from "@/types/three";
export function useOctreeGraphNode( export function useOctreeGraphNode(
graphNodeRef: RefObject<Object3D | null>, graphNodeRef: RefObject<Object3D | null>,
+1 -1
View File
@@ -1,4 +1,4 @@
import type { Vector3Tuple } from "./3d"; import type { Vector3Tuple } from "./three";
export interface MapNode { export interface MapNode {
name: string; name: string;
@@ -8,7 +8,7 @@ import {
PLAYER_EYE_HEIGHT, PLAYER_EYE_HEIGHT,
PLAYER_SPAWN_POSITION_GAME, PLAYER_SPAWN_POSITION_GAME,
} from "@/data/player/playerConfig"; } from "@/data/player/playerConfig";
import type { Vector3Tuple } from "@/types/3d"; import type { Vector3Tuple } from "@/types/three";
const DEBUG_CAMERA_TARGET: Vector3Tuple = [ const DEBUG_CAMERA_TARGET: Vector3Tuple = [
PLAYER_SPAWN_POSITION_GAME[0], PLAYER_SPAWN_POSITION_GAME[0],
+1 -1
View File
@@ -3,7 +3,7 @@ import { useGLTF } from "@react-three/drei";
import * as THREE from "three"; import * as THREE from "three";
import { useOctreeGraphNode } from "@/hooks/useOctreeGraphNode"; import { useOctreeGraphNode } from "@/hooks/useOctreeGraphNode";
import { loadMapSceneData } from "@/utils/loadMapSceneData"; import { loadMapSceneData } from "@/utils/loadMapSceneData";
import type { OctreeReadyHandler } from "@/types/3d"; import type { OctreeReadyHandler } from "@/types/three";
import type { MapNode } from "@/types/editor"; import type { MapNode } from "@/types/editor";
interface GameMapProps { interface GameMapProps {
+2 -2
View File
@@ -11,7 +11,7 @@ import { DebugHelpers } from "@/utils/debug/scene/DebugHelpers";
import { Environment } from "@/world/Environment"; import { Environment } from "@/world/Environment";
import { Lighting } from "@/world/Lighting"; import { Lighting } from "@/world/Lighting";
import { GameMap } from "@/world/GameMap"; import { GameMap } from "@/world/GameMap";
import { PlayerComponent } from "@/world/player/PlayerComponent"; import { Player } from "@/world/player/Player";
import { TestScene } from "@/world/debug/TestScene"; import { TestScene } from "@/world/debug/TestScene";
export function World(): React.JSX.Element { export function World(): React.JSX.Element {
@@ -37,7 +37,7 @@ export function World(): React.JSX.Element {
)} )}
{cameraMode !== "debug" ? ( {cameraMode !== "debug" ? (
<PlayerComponent octree={octree} spawnPosition={playerSpawnPosition} /> <Player octree={octree} spawnPosition={playerSpawnPosition} />
) : null} ) : null}
</> </>
); );
+3 -3
View File
@@ -1,8 +1,8 @@
import { useRef } from "react"; import { useRef } from "react";
import { Physics, RigidBody, CuboidCollider } from "@react-three/rapier"; import { Physics, RigidBody, CuboidCollider } from "@react-three/rapier";
import * as THREE from "three"; import * as THREE from "three";
import { GrabbableObject } from "@/components/3d/GrabbableObject"; import { GrabbableObject } from "@/components/three/GrabbableObject";
import { TriggerObject } from "@/components/3d/TriggerObject"; import { TriggerObject } from "@/components/three/TriggerObject";
import { import {
TEST_SCENE_FLOOR_COLLIDER_HALF_EXTENTS, TEST_SCENE_FLOOR_COLLIDER_HALF_EXTENTS,
TEST_SCENE_FLOOR_POSITION, TEST_SCENE_FLOOR_POSITION,
@@ -21,7 +21,7 @@ import {
TEST_SCENE_TRIGGER_SOUND_PATH, TEST_SCENE_TRIGGER_SOUND_PATH,
} from "@/data/debug/testSceneConfig"; } from "@/data/debug/testSceneConfig";
import { useOctreeGraphNode } from "@/hooks/useOctreeGraphNode"; import { useOctreeGraphNode } from "@/hooks/useOctreeGraphNode";
import type { OctreeReadyHandler } from "@/types/3d"; import type { OctreeReadyHandler } from "@/types/three";
interface TestSceneProps { interface TestSceneProps {
onOctreeReady: OctreeReadyHandler; onOctreeReady: OctreeReadyHandler;
@@ -1,19 +1,19 @@
import { useEffect } from "react"; import { useEffect } from "react";
import { useThree } from "@react-three/fiber"; import { useThree } from "@react-three/fiber";
import type { Octree } from "three/addons/math/Octree.js"; import type { Octree } from "three/addons/math/Octree.js";
import type { Vector3Tuple } from "@/types/3d"; import type { Vector3Tuple } from "@/types/three";
import { PlayerCamera } from "@/world/player/PlayerCamera"; import { PlayerCamera } from "@/world/player/PlayerCamera";
import { PlayerController } from "@/world/player/PlayerController"; import { PlayerController } from "@/world/player/PlayerController";
interface PlayerComponentProps { interface PlayerProps {
octree: Octree | null; octree: Octree | null;
spawnPosition: Vector3Tuple; spawnPosition: Vector3Tuple;
} }
export function PlayerComponent({ export function Player({
spawnPosition, spawnPosition,
octree, octree,
}: PlayerComponentProps): React.JSX.Element { }: PlayerProps): React.JSX.Element {
const camera = useThree((state) => state.camera); const camera = useThree((state) => state.camera);
useEffect(() => { useEffect(() => {
+2 -2
View File
@@ -23,8 +23,8 @@ import {
PLAYER_WALK_SPEED, PLAYER_WALK_SPEED,
PLAYER_XZ_DAMPING_FACTOR, PLAYER_XZ_DAMPING_FACTOR,
} from "@/data/player/playerConfig"; } from "@/data/player/playerConfig";
import { InteractionManager } from "@/stateManager/InteractionManager"; import { InteractionManager } from "@/managers/InteractionManager";
import type { Vector3Tuple } from "@/types/3d"; import type { Vector3Tuple } from "@/types/three";
type Keys = { type Keys = {
forward: boolean; forward: boolean;