1
0
Эх сурвалжийг харах

feat: use `getObjectByProperty` to get the camera

alvarosabu 2 жил өмнө
parent
commit
495479a253

+ 1 - 1
src/components/TresScene.ts

@@ -93,7 +93,7 @@ export const TresScene = defineComponent<TresSceneProps>({
     const { activeCamera, pushCamera, clearCameras } = useCamera()
 
     function setCamera() {
-      const camera = scene.children.find((child: any) => child.isCamera)
+      const camera = scene.getObjectByProperty('isCamera', true)
 
       if (!camera) {
         // eslint-disable-next-line max-len