From db86507bad665ded374c4a0766ccb742374d4e1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=97=8D+85CD?= <50108258+kwaa@users.noreply.github.com> Date: Fri, 4 Oct 2024 19:10:49 +0800 Subject: [PATCH] refactor(stage): update controls --- src/components/stage.tsx | 40 ++++++++++++++++++++++++++++------------ 1 file changed, 28 insertions(+), 12 deletions(-) diff --git a/src/components/stage.tsx b/src/components/stage.tsx index 112ef03..fa9c7a7 100644 --- a/src/components/stage.tsx +++ b/src/components/stage.tsx @@ -1,21 +1,35 @@ import { Environment, SoftShadows } from '@react-three/drei' import { IfInSessionMode } from '@react-three/xr' -import { useControls } from 'leva' +import { folder, useControls } from 'leva' export const Stage = ({ children }: React.PropsWithChildren) => { const { - background, backgroundBlurriness, - ground, + backgroundEnable, + backgroundIntensity, + backgroundRotation, + groundEnable, + groundHeight, + groundRadius, + groundScale, // preset, } = useControls('Stage', { - background: true, - backgroundBlurriness: { - max: 1, - min: 0, - value: 0.5, - }, - ground: false, + background: folder({ + backgroundBlurriness: { + max: 1, + min: 0, + value: 0.5, + }, + backgroundEnable: true, + backgroundIntensity: 1, + backgroundRotation: [0, 0, 0], + }), + ground: folder({ + groundEnable: false, + groundHeight: 39, + groundRadius: 100, + groundScale: 100, + }), // preset: 'dawn', }) @@ -23,10 +37,12 @@ export const Stage = ({ children }: React.PropsWithChildren) => { <>