Skip to content

Commit

Permalink
fix: incorrect implementation of disable render on canvas
Browse files Browse the repository at this point in the history
  • Loading branch information
alvarosabu committed Apr 18, 2023
1 parent 133d951 commit 2442935
Showing 1 changed file with 3 additions and 15 deletions.
18 changes: 3 additions & 15 deletions src/components/TresScene.ts
Original file line number Diff line number Diff line change
@@ -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'
Expand Down Expand Up @@ -75,19 +75,6 @@ export const TresScene = defineComponent<TresSceneProps>({
}
}

/* 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()
})
Expand All @@ -113,7 +100,8 @@ export const TresScene = defineComponent<TresSceneProps>({
})

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)
Expand Down

0 comments on commit 2442935

Please sign in to comment.