refactor: clean architecture and remove unused code

This commit is contained in:
Tom Boullay
2026-04-30 13:33:28 +02:00
parent c698b9ef78
commit fda70bade2
30 changed files with 303 additions and 696 deletions
@@ -1,7 +1,8 @@
import { useMemo, useState } from "react";
import { useState } from "react";
import { useGLTF } from "@react-three/drei";
import { RigidBody } from "@react-three/rapier";
import { InteractableObject } from "@/components/three/interaction/InteractableObject";
import { useClonedObject } from "@/hooks/three/useClonedObject";
import {
TRIGGER_DEFAULT_COLLIDERS,
TRIGGER_DEFAULT_LABEL,
@@ -38,7 +39,7 @@ function SpawnedModelInstance({
position: Vector3Tuple;
}): React.JSX.Element {
const { scene } = useGLTF(path);
const model = useMemo(() => scene.clone(true), [scene]);
const model = useClonedObject(scene);
return <primitive object={model} position={position} />;
}