Skip to content

Commit

Permalink
fix(components): Get camera from useFrame
Browse files Browse the repository at this point in the history
Access camera via useFram arguments rather than useThree hooks
  • Loading branch information
alimoezzi committed Mar 8, 2022
1 parent 1128af5 commit effd3b2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/components/overlay/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ import React, { useMemo, useRef } from 'react'
import { Scene } from 'three'

export function Overlay({ children, position }) {
const { scene, camera } = useThree()
const { scene } = useThree()
const virtualScene = useMemo(() => new Scene())
const virtualCam = useRef()
const ref = useRef()

useFrame(({ gl }) => {
useFrame(({ gl, camera }) => {
// ref.current.quaternion.setFromEuler(new THREE.Euler(1, 1, 1))
// eslint-disable-next-line no-param-reassign
gl.autoClear = true
Expand Down

0 comments on commit effd3b2

Please sign in to comment.