From ed9051b0dcbb92a738bfb63a4ca91595698d918b Mon Sep 17 00:00:00 2001 From: math-pixel <59537610+math-pixel@users.noreply.github.com> Date: Tue, 19 May 2026 16:10:57 +0200 Subject: [PATCH] working move kikle --- src/components/ebike/Ebike.tsx | 2 +- src/world/player/PlayerController.tsx | 13 ++++--------- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/src/components/ebike/Ebike.tsx b/src/components/ebike/Ebike.tsx index 35686bf..e543d50 100644 --- a/src/components/ebike/Ebike.tsx +++ b/src/components/ebike/Ebike.tsx @@ -18,7 +18,7 @@ export interface CameraTransform { } export const EBIKE_CAMERA_TRANSFORM: CameraTransform = { - position: [-3, 6, 0], + position: [-3.5, 6, 0], rotation: [-10, -90, 0], }; diff --git a/src/world/player/PlayerController.tsx b/src/world/player/PlayerController.tsx index b625133..69b15ce 100644 --- a/src/world/player/PlayerController.tsx +++ b/src/world/player/PlayerController.tsx @@ -278,16 +278,11 @@ export function PlayerController({ } } - if (movementModeRef.current === "ebike") { - _forward.set(Math.sin(ebikeAngle.current), 0, Math.cos(ebikeAngle.current)).normalize(); + camera.getWorldDirection(_forward); + _forward.setY(0); + if (_forward.lengthSq() > 0) { + _forward.normalize(); _right.crossVectors(_forward, _up).normalize(); - } else { - camera.getWorldDirection(_forward); - _forward.setY(0); - if (_forward.lengthSq() > 0) { - _forward.normalize(); - _right.crossVectors(_forward, _up).normalize(); - } } _wishDir.set(0, 0, 0);