add good inclinason cam

This commit is contained in:
math-pixel
2026-05-19 15:54:40 +02:00
parent ce0eb90321
commit 08be6bee48
+26 -13
View File
@@ -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 (
<>
<group ref={groupRef} position={position}>