feat: restaure l'éditeur map et ajoute les personnages
🔍 Lint / 🪄 Check lint (pull_request) Has been cancelled
🔍 Lint / 🎨 Check format (pull_request) Has been cancelled
🔍 Lint / 🔎 Typecheck (pull_request) Has been cancelled
📊 Quality / 🔒 Security Audit (pull_request) Has been cancelled
📊 Quality / 📋 Dependency Freshness (pull_request) Has been cancelled
📊 Quality / 📦 Bundle Size (pull_request) Has been cancelled
🔍 Lint / 🏗 Build (pull_request) Has been cancelled
🔍 Lint / 🪄 Check lint (pull_request) Has been cancelled
🔍 Lint / 🎨 Check format (pull_request) Has been cancelled
🔍 Lint / 🔎 Typecheck (pull_request) Has been cancelled
📊 Quality / 🔒 Security Audit (pull_request) Has been cancelled
📊 Quality / 📋 Dependency Freshness (pull_request) Has been cancelled
📊 Quality / 📦 Bundle Size (pull_request) Has been cancelled
🔍 Lint / 🏗 Build (pull_request) Has been cancelled
This commit is contained in:
@@ -7,6 +7,7 @@ import {
|
||||
import { useCameraMode } from "@/hooks/debug/useCameraMode";
|
||||
import { useEnvironmentDebug } from "@/hooks/debug/useEnvironmentDebug";
|
||||
import { useMapPerformanceDebug } from "@/hooks/debug/useMapPerformanceDebug";
|
||||
import { usePersonnageDebug } from "@/hooks/debug/usePersonnageDebug";
|
||||
import { useSceneMode } from "@/hooks/debug/useSceneMode";
|
||||
import { useHandTrackingSnapshot } from "@/hooks/handTracking/useHandTrackingSnapshot";
|
||||
import { useWorldSceneLoading } from "@/hooks/world/useWorldSceneLoading";
|
||||
@@ -28,6 +29,7 @@ import { GameMusic } from "@/world/GameMusic";
|
||||
import { Lighting } from "@/world/Lighting";
|
||||
import { GameMap } from "@/world/GameMap";
|
||||
import { GameStageContent } from "@/world/GameStageContent";
|
||||
import { PersonnageSystem } from "@/world/personnages/PersonnageSystem";
|
||||
import { Player } from "@/world/player/Player";
|
||||
import { TestMap } from "@/world/debug/TestMap";
|
||||
import type { SceneLoadingChangeHandler } from "@/types/world/sceneLoading";
|
||||
@@ -39,6 +41,7 @@ interface WorldProps {
|
||||
export function World({ onLoadingStateChange }: WorldProps): React.JSX.Element {
|
||||
useEnvironmentDebug();
|
||||
useMapPerformanceDebug();
|
||||
usePersonnageDebug();
|
||||
|
||||
const cameraMode = useCameraMode();
|
||||
const sceneMode = useSceneMode();
|
||||
@@ -87,6 +90,7 @@ export function World({ onLoadingStateChange }: WorldProps): React.JSX.Element {
|
||||
onLoadingStateChange={onLoadingStateChange}
|
||||
onOctreeReady={handleOctreeReady}
|
||||
/>
|
||||
<PersonnageSystem />
|
||||
{showGameStage ? (
|
||||
<Physics>
|
||||
<GameStageLoaded onLoaded={handleGameStageLoaded} />
|
||||
|
||||
@@ -31,7 +31,7 @@ import type { OctreeReadyHandler } from "@/types/three/three";
|
||||
import { logModelLoadError } from "@/utils/three/modelLoadLogger";
|
||||
|
||||
const ELECTRICIENNE_ANIMATED_MODEL_PATH =
|
||||
"/models/electricienne_animated/model.gltf";
|
||||
"/models/electricienne-animated/model.gltf";
|
||||
|
||||
interface TestMapProps {
|
||||
onOctreeReady: OctreeReadyHandler;
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
import { Suspense } from "react";
|
||||
import { AnimatedModel } from "@/components/three/models/AnimatedModel";
|
||||
import {
|
||||
PERSONNAGE_CONFIGS,
|
||||
PERSONNAGE_IDS,
|
||||
type PersonnageId,
|
||||
} from "@/data/world/personnages/personnageConfig";
|
||||
import { useTerrainSnappedPosition } from "@/hooks/three/useTerrainHeight";
|
||||
import { usePersonnageDebugStore } from "@/managers/stores/usePersonnageDebugStore";
|
||||
|
||||
function PersonnageModel({ id }: { id: PersonnageId }): React.JSX.Element {
|
||||
const config = PERSONNAGE_CONFIGS[id];
|
||||
const state = usePersonnageDebugStore((store) => store.personnages[id]);
|
||||
const position = useTerrainSnappedPosition(state.position);
|
||||
|
||||
return (
|
||||
<AnimatedModel
|
||||
modelPath={config.modelPath}
|
||||
defaultAnimation={state.animation}
|
||||
position={position}
|
||||
rotation={state.rotation}
|
||||
scale={state.scale}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
export function PersonnageSystem(): React.JSX.Element {
|
||||
return (
|
||||
<group name="personnage-system">
|
||||
{PERSONNAGE_IDS.map((id) => (
|
||||
<Suspense key={id} fallback={null}>
|
||||
<PersonnageModel id={id} />
|
||||
</Suspense>
|
||||
))}
|
||||
</group>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user