refactor: update position and rotation types to use Vector3 for consistency
This commit is contained in:
@@ -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 && (
|
||||
|
||||
Reference in New Issue
Block a user