working move kikle

This commit is contained in:
math-pixel
2026-05-19 16:10:57 +02:00
parent 08be6bee48
commit ed9051b0dc
2 changed files with 5 additions and 10 deletions
+1 -1
View File
@@ -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],
};
+4 -9
View File
@@ -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);