refactor: update position and rotation types to use Vector3 for consistency

This commit is contained in:
2025-04-11 14:23:30 +05:30
parent 14d3de4ece
commit 737094848f
3 changed files with 15 additions and 13 deletions

View File

@@ -1,12 +1,14 @@
import { useLoader } from "@react-three/fiber";
import { Vector3 } from "three";
import { DRACOLoader } from "three/examples/jsm/loaders/DRACOLoader";
import { GLTFLoader } from "three/examples/jsm/loaders/GLTFLoader";
import { clone } from "three/examples/jsm/utils/SkeletonUtils";
interface MultiGLTFInstancesProps {
index: number;
modelUrl: string;
position: [number, number, number];
rotation: [number, number, number];
position: Vector3;
rotation: Vector3;
visibility?: boolean;
}
@@ -25,8 +27,7 @@ export const MultiGLTFInstances: React.FC<MultiGLTFInstancesProps> = ({
);
loader.setDRACOLoader(draco);
});
const cloned = originalGltf.scene.clone();
console.log(index);
const cloned = clone(originalGltf.scene);
return (
<>
{visibility && (