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