fix electricienne debug model loading
This commit is contained in:
@@ -21,11 +21,16 @@ export function HandTrackingDebugPanel(): React.JSX.Element | null {
|
||||
}
|
||||
|
||||
const fist = hands.some((hand) => hand.isFist);
|
||||
const modelLoaded = hands.some(
|
||||
const hasLeftHand = hands.some(
|
||||
(hand) => hand.handedness.toLowerCase() === "left",
|
||||
)
|
||||
? "gant_l"
|
||||
: "none";
|
||||
);
|
||||
const hasRightHand = hands.some(
|
||||
(hand) => hand.handedness.toLowerCase() === "right",
|
||||
);
|
||||
const modelLoaded =
|
||||
[hasLeftHand ? "gant_l" : null, hasRightHand ? "gant_r" : null]
|
||||
.filter(Boolean)
|
||||
.join(", ") || "none";
|
||||
|
||||
return (
|
||||
<section
|
||||
|
||||
@@ -5,7 +5,10 @@ export interface ModelCatalogItem {
|
||||
|
||||
export const REPAIR_GAME_MODEL_CATALOG: ModelCatalogItem[] = [
|
||||
{ name: "Electricienne", path: "/models/elecsimple/model.gltf" },
|
||||
{ name: "Electricienne complete", path: "/models/elec/model.gltf" },
|
||||
{
|
||||
name: "Electricienne complete",
|
||||
path: "/models/electricienne_animated/model.gltf",
|
||||
},
|
||||
{ name: "Eolienne", path: "/models/eolienne/model.gltf" },
|
||||
{ name: "Fermier", path: "/models/fermier/model.gltf" },
|
||||
{ name: "Galet", path: "/models/galet/model.gltf" },
|
||||
|
||||
+5
-1
@@ -1,5 +1,6 @@
|
||||
import { Suspense } from "react";
|
||||
import { Canvas } from "@react-three/fiber";
|
||||
import * as THREE from "three";
|
||||
import { DebugPerf } from "@/components/debug/DebugPerf";
|
||||
import { GameUI } from "@/components/ui/GameUI";
|
||||
import { HandTrackingProvider } from "@/providers/gameplay/HandTrackingProvider";
|
||||
@@ -8,7 +9,10 @@ import { World } from "@/world/World";
|
||||
export function HomePage(): React.JSX.Element {
|
||||
return (
|
||||
<HandTrackingProvider>
|
||||
<Canvas camera={{ position: [85, 60, 85], fov: 42 }} shadows>
|
||||
<Canvas
|
||||
camera={{ position: [85, 60, 85], fov: 42 }}
|
||||
shadows={{ type: THREE.PCFShadowMap }}
|
||||
>
|
||||
<Suspense fallback={null}>
|
||||
<World />
|
||||
<DebugPerf />
|
||||
|
||||
@@ -27,6 +27,9 @@ import { useOctreeGraphNode } from "@/hooks/three/useOctreeGraphNode";
|
||||
import type { OctreeReadyHandler } from "@/types/three/three";
|
||||
import { logModelLoadError } from "@/utils/three/modelLoadLogger";
|
||||
|
||||
const ELECTRICIENNE_ANIMATED_MODEL_PATH =
|
||||
"/models/electricienne_animated/model.gltf";
|
||||
|
||||
interface TestMapProps {
|
||||
onOctreeReady: OctreeReadyHandler;
|
||||
}
|
||||
@@ -134,9 +137,9 @@ export function TestMap({ onOctreeReady }: TestMapProps): React.JSX.Element {
|
||||
<RepairGameZone />
|
||||
</Physics>
|
||||
|
||||
<ModelPreviewErrorBoundary modelPath="/models/elec/model.gltf">
|
||||
<ModelPreviewErrorBoundary modelPath={ELECTRICIENNE_ANIMATED_MODEL_PATH}>
|
||||
<AnimatedModel
|
||||
modelPath="/models/elec/model.gltf"
|
||||
modelPath={ELECTRICIENNE_ANIMATED_MODEL_PATH}
|
||||
defaultAnimation="Idle"
|
||||
position={[0, 0, -5]}
|
||||
scale={1}
|
||||
|
||||
Reference in New Issue
Block a user