From 28f9d6aadef16cafb888ff6bcc97f99bde971d8d Mon Sep 17 00:00:00 2001 From: luxiaotao1123 <t1341870251@163.com> Date: 星期五, 10 五月 2024 13:58:20 +0800 Subject: [PATCH] # --- src/components/camera.jsx | 27 +++++++++++++-------------- 1 files changed, 13 insertions(+), 14 deletions(-) diff --git a/src/components/camera.jsx b/src/components/camera.jsx index 1fbbc1b..a740fc4 100644 --- a/src/components/camera.jsx +++ b/src/components/camera.jsx @@ -1,5 +1,5 @@ -// 娣诲姞鍦烘櫙鐩告満 -import { useThree, PerspectiveCameraProps } from '@react-three/fiber'; +import React, { useState, useEffect } from 'react'; +import { useThree } from '@react-three/fiber'; import { PerspectiveCamera, CameraControls, @@ -9,14 +9,23 @@ FirstPersonControls, MapControls, } from '@react-three/drei'; -import React, { useState, useEffect } from 'react'; const Camera = (props) => { const threeObj = useThree(); const camera = threeObj.camera; const [choiceCtrls, setChoiceCtrls] = useState(true); - const mobxStore = useContext(ThreeStoreContext); + + const ctrl = () => { + return ( + <group> + {/* 鐩告満鎺у埗鍣� */} + {/* <PresentationControls /> */} + <CameraControls /> + {/* <PointerCtrl /> */} + </group> + ); + }; const flyCtrl = () => { return ( @@ -33,16 +42,6 @@ ); }; - const ctrl = () => { - return ( - <group> - {/* 鐩告満鎺у埗鍣� */} - {/* <PresentationControls /> */} - <CameraControls /> - {/* <PointerCtrl /> */} - </group> - ); - }; return ( <> {choiceCtrls ? ctrl() : flyCtrl()} -- Gitblit v1.9.1