Преглед изворни кода

feat: use `getObjectByProperty` to get the camera

alvarosabu пре 2 година
родитељ
комит
495479a253
1 измењених фајлова са 1 додато и 1 уклоњено
  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()
     const { activeCamera, pushCamera, clearCameras } = useCamera()
 
 
     function setCamera() {
     function setCamera() {
-      const camera = scene.children.find((child: any) => child.isCamera)
+      const camera = scene.getObjectByProperty('isCamera', true)
 
 
       if (!camera) {
       if (!camera) {
         // eslint-disable-next-line max-len
         // eslint-disable-next-line max-len