diff --git a/src/components/TresScene.ts b/src/components/TresScene.ts index bb8d54943..d8dcc965b 100644 --- a/src/components/TresScene.ts +++ b/src/components/TresScene.ts @@ -1,6 +1,6 @@ import { App, defineComponent, h, onMounted, onUnmounted, ref, watchEffect } from 'vue' import * as THREE from 'three' -import { PerspectiveCamera, ShadowMapType, TextureEncoding, ToneMapping } from 'three' +import { ShadowMapType, TextureEncoding, ToneMapping } from 'three' import { createTres } from '/@/core/renderer' import { useLogger } from '/@/composables' import { useCamera, useRenderer, useRenderLoop, useRaycaster, useTres } from '/@/composables' @@ -75,19 +75,6 @@ export const TresScene = defineComponent({ } } - /* watchEffect(() => { - if (!slots) return - const slots = Object.keys(slots.default()).filter(slot => slot.startsWith('camera')) - isCameraAvailable.value = slots.length > 0 - - if (!isCameraAvailable.value) { - logWarning('No camera found in the scene, please add one!') - } - }) */ - - /* const { pushCamera } = useCamera() - pushCamera(new PerspectiveCamera()) */ - onMounted(() => { initRenderer() }) @@ -113,7 +100,8 @@ export const TresScene = defineComponent({ }) onLoop(() => { - if (activeCamera.value && props.disableRender === true) renderer.value?.render(scene, activeCamera.value) + if (activeCamera.value && props.disableRender !== true && props.disableRender !== '') + renderer.value?.render(scene, activeCamera.value) if (raycaster.value) { const intersects = raycaster.value.intersectObjects(scene.children)