From 08be6bee487be7baa8bb851e5186463bcae96fcf Mon Sep 17 00:00:00 2001 From: math-pixel <59537610+math-pixel@users.noreply.github.com> Date: Tue, 19 May 2026 15:54:40 +0200 Subject: [PATCH] add good inclinason cam --- src/components/ebike/Ebike.tsx | 39 ++++++++++++++++++++++------------ 1 file changed, 26 insertions(+), 13 deletions(-) diff --git a/src/components/ebike/Ebike.tsx b/src/components/ebike/Ebike.tsx index b0773f0..35686bf 100644 --- a/src/components/ebike/Ebike.tsx +++ b/src/components/ebike/Ebike.tsx @@ -18,13 +18,13 @@ export interface CameraTransform { } export const EBIKE_CAMERA_TRANSFORM: CameraTransform = { - position: [-3, 8, 0], - rotation: [0, 0, 0], + position: [-3, 6, 0], + rotation: [-10, -90, 0], }; const EBIKE_DROP_PLAYER_TRANSFORM: CameraTransform = { position: [3, 1.5, 0], - rotation: [90, 90, 0], + rotation: [0, 0, 0], }; interface EbikeProps { @@ -58,16 +58,6 @@ export function Ebike({ position }: EbikeProps): React.JSX.Element { } }); - const debugRef = useRef({ showCameraPoints: true }); - useDebugFolder("Ebike", (folder) => { - folder - .add(debugRef.current, "showCameraPoints") - .name("Show Camera Points") - .onChange((value: boolean) => { - debugRef.current.showCameraPoints = value; - }); - }); - const camPointPos: Vector3Tuple = [ position[0] + EBIKE_CAMERA_TRANSFORM.position[0], position[1] + EBIKE_CAMERA_TRANSFORM.position[1], @@ -114,6 +104,29 @@ export function Ebike({ position }: EbikeProps): React.JSX.Element { } }; + const handleInteractRef = useRef(handleInteract); + handleInteractRef.current = handleInteract; + + const debugRef = useRef({ showCameraPoints: true }); + const debugActions = useRef({ + toggleRide: () => { + handleInteractRef.current(); + } + }); + + useDebugFolder("Ebike", (folder) => { + folder + .add(debugRef.current, "showCameraPoints") + .name("Show Camera Points") + .onChange((value: boolean) => { + debugRef.current.showCameraPoints = value; + }); + + folder + .add(debugActions.current, "toggleRide") + .name("Monter / Descendre"); + }); + return ( <>