fix(ebike): allow player input during mount/dismount camera transition
Add lockInput option (default true) to animateCameraTransformTransition so ebike mount/dismount can keep player input active during the 1s camera tween instead of locking via setCinematicPlaying. Also drop the unused camPointPos/dropPointPos debug vars and the matching debugRestingPosition state — the consuming JSX has been commented out for a while.
This commit is contained in:
@@ -242,7 +242,10 @@ export function animateCameraTransformTransition(
|
||||
targetRotation: Vector3Tuple,
|
||||
duration: number = 1,
|
||||
onComplete?: () => void,
|
||||
options: { lockInput?: boolean } = {},
|
||||
): void {
|
||||
const { lockInput = true } = options;
|
||||
|
||||
if (!globalCamera) {
|
||||
logger.warn("GameCinematics", "Camera not found for transition");
|
||||
onComplete?.();
|
||||
@@ -252,7 +255,9 @@ export function animateCameraTransformTransition(
|
||||
const camera = globalCamera;
|
||||
|
||||
cameraTransitionTimeline?.kill();
|
||||
useGameStore.getState().setCinematicPlaying(true);
|
||||
if (lockInput) {
|
||||
useGameStore.getState().setCinematicPlaying(true);
|
||||
}
|
||||
|
||||
// Convert target rotation in degrees to quaternion
|
||||
const targetEuler = new THREE.Euler(
|
||||
@@ -274,7 +279,9 @@ export function animateCameraTransformTransition(
|
||||
},
|
||||
onComplete: () => {
|
||||
cameraTransitionTimeline = null;
|
||||
useGameStore.getState().setCinematicPlaying(false);
|
||||
if (lockInput) {
|
||||
useGameStore.getState().setCinematicPlaying(false);
|
||||
}
|
||||
onComplete?.();
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user