Browse Source

feat: use `getObjectByProperty` to get the camera

alvarosabu 2 năm trước cách đây
mục cha
commit
495479a253
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  1. 1 1
      src/components/TresScene.ts

+ 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