Skip to content

Dodaios is an open-source agent OS for your desktop: it runs your coding agents, browser and apps by voice or chat, on your own machine. Formerly Personal Jarvis.

fix(verse): fly the courier by mouse aim, with cursor steering when the mouse cannot be captured (#698)

Ruben Lütke471eeb7082c2
diff --git a/docs/agent-society/office-map.md b/docs/agent-society/office-map.md
index 0100a86f32..990684fd3e 100644
--- a/docs/agent-society/office-map.md
+++ b/docs/agent-society/office-map.md
@@ -657,8 +657,14 @@ street of team rooms round an atrium, with commons people use in between.
attitude, and it banks into turns and levels its wings (never its nose);
*simulation* is Newtonian with momentum and drift. Cruise 85 m/s, boost
to 170 m/s on a charge that drains and refills, brake. A click into the
- view captures the mouse as a stick that springs back to the middle
- (sideways turns, forwards and back pitches; Escape lets it go). Every tower, the Dodaios tower with its floor, the pad, the
+ view captures the mouse for *mouse aim*: moving it moves a ring (where the
+ pilot aims), a dot marks where the nose points, and the ship keeps
+ turning onto the ring by itself whether or not the mouse is still moving;
+ the chase camera looks along the aim, and the turn and pitch keys move the
+ ring too (Escape lets the mouse go). Where the host refuses to capture the
+ mouse (an unfocused window, an embedded view), the visible cursor steers
+ instead: its distance from the middle of the view sets how fast the ring
+ turns, and a cursor resting off the middle keeps turning. Every tower, the Dodaios tower with its floor, the pad, the
street level and the singularity's core are solid (`courierWorld.ts`):
the ship bounces off in sub-steps no longer than 1.5 m (no tunnelling at
full boost), its shield flashes and the camera shakes. Past the city's
@@ -685,8 +691,8 @@ street of team rooms round an atrium, with commons people use in between.
| Action | Keys | Gamepad |
| --- | --- | --- |
| Throttle up / down | W / S | right / left trigger |
- | Turn left / right | A / D (or the mouse) | left stick x |
- | Nose up / down | ↑ / ↓ (or the mouse) | left stick y |
+ | Turn left / right | A / D (or the mouse aim) | left stick x |
+ | Nose up / down | ↑ / ↓ (or the mouse aim) | left stick y |
| Roll left / right | Q / E, ← / → | right stick x |
| Rise / sink | Space / C or Ctrl | right stick y |
| Boost / brake | Shift / X | A / B |
diff --git a/jarvis/ui/web/frontend/src/components/society/office/CourierHud.tsx b/jarvis/ui/web/frontend/src/components/society/office/CourierHud.tsx
index 3d0c7bcb48..95a9267d51 100644
--- a/jarvis/ui/web/frontend/src/components/society/office/CourierHud.tsx
+++ b/jarvis/ui/web/frontend/src/components/society/office/CourierHud.tsx
@@ -36,12 +36,16 @@ export function CourierHud() {
const settingsOpen = useCourier((s) => s.settingsOpen);
const bindings = useCourier((s) => s.bindings);
const mouseLocked = useCourier((s) => s.mouseLocked);
+ const cursorAim = useCourier((s) => s.cursorAim);
const store = useCourier.getState;
const kmh = Math.round(telemetry.speed * 3.6);
const boostShare = Math.min(1, telemetry.speed / FLIGHT.boost);
const keysOf = (action: FlightAction) => keysLabel(bindings[action]);
return (
<>
+ {/* Placed by the scene each frame: where the pilot aims, and where the nose points. */}
+ <div id="courier-aim" className="courier-aim" aria-hidden />
+ <div id="courier-nose" className="courier-nose" aria-hidden />
<div className="courier-hud office-card" data-office-ui role="group" aria-label={t("society.office.flight_hud")}>
<div className="courier-speed" aria-live="off">
<strong>{kmh}</strong><span>km/h</span>
@@ -72,7 +76,7 @@ export function CourierHud() {
</div>
{telemetry.landed
? <p className="office-hint">{t("society.office.flight_landed_hint").replace("{0}", keysOf("exit"))}</p>
- : <p className="office-hint">{t(mouseLocked ? "society.office.flight_mouse_on" : "society.office.flight_mouse_hint")}</p>}
+ : <p className="office-hint">{t(mouseLocked ? "society.office.flight_mouse_on" : cursorAim ? "society.office.flight_mouse_cursor" : "society.office.flight_mouse_hint")}</p>}
</div>
{helpOpen && !settingsOpen && (
<div className="courier-help office-card" data-office-ui>
diff --git a/jarvis/ui/web/frontend/src/components/society/office/SkyCourier.tsx b/jarvis/ui/web/frontend/src/components/society/office/SkyCourier.tsx
index a14573a828..48272ffb64 100644
--- a/jarvis/ui/web/frontend/src/components/society/office/SkyCourier.tsx
+++ b/jarvis/ui/web/frontend/src/components/society/office/SkyCourier.tsx
@@ -27,7 +27,7 @@ import courierFar from "@/assets/society/courier/courier-lod2.glb";
import { planCity } from "./cityPlan";
import { cachedCanvasTexture } from "./canvasMaterials";
import { CourierEngineSound } from "./courierAudio";
-import { addMouse, FLIGHT_ACTIONS, flightInput, PAD_PRESSES, PRESS_ACTIONS, type FlightAction, type PadState } from "./courierControls";
+import { aimDirection, aimFromForward, cursorTurn, FLIGHT_ACTIONS, flightInput, moveAim, PAD_PRESSES, steerTowards, type MouseAim, PRESS_ACTIONS, type FlightAction, type PadState } from "./courierControls";
import { engageAutopilot, FLIGHT, forwardOf, heightOverDeck, NO_INPUT, parkedState, stepFlight, type FlightState } from "./courierFlight";
import { courierSession, useCourier } from "./courierStore";
import { buildCourierWorld, rayDistance } from "./courierWorld";
@@ -363,8 +363,11 @@ function Courier({ layout, pad, reduced, awake }: { layout: OfficeLayout; pad: S
// The keys and the sound belong to a flight on screen: another section or a hidden window gets its keys back.
const live = flying && awake;
const held = useRef(new Set<string>());
- /** Mouse movement while the pointer is captured: a virtual stick that springs back to the middle. */
- const mouse = useRef({ x: 0, y: 0 });
+ /** Where the pilot aims while the mouse is captured; the ship turns towards it by itself. */
+ const aim = useRef<MouseAim>({ yaw: 0, pitch: 0 });
+ const aimDir = useMemo(() => new Vector3(), []);
+ /** The cursor's place in the view (-1..1, +y up) while cursor steering is on and it is over the view. */
+ const cursor = useRef<{ x: number; y: number } | null>(null);
const padPressed = useRef(new Set<number>());
const sound = useRef<CourierEngineSound | null>(null);
const camPos = useRef(new Vector3());
@@ -454,22 +457,44 @@ function Courier({ layout, pad, reduced, awake }: { layout: OfficeLayout; pad: S
const blur = () => held.current.clear();
// A click into the view captures the mouse for steering; Escape (the browser's own) lets it go again.
const canvas = gl.domElement;
+ // Some hosts refuse to capture the mouse (an unfocused window, an embedded view): then the cursor steers.
+ const refused = (error: unknown) => {
+ console.warn("mouse capture refused, steering with the cursor", error);
+ if (!useCourier.getState().cursorAim) Object.assign(aim.current, aimFromForward(forwardOf(state.current.q)));
+ useCourier.getState().set({ cursorAim: true });
+ };
const capture = () => {
if (document.pointerLockElement === canvas || useCourier.getState().settingsOpen) return;
+ if (!canvas.requestPointerLock) { refused(new Error("pointer lock unsupported")); return; }
try {
- const pending = canvas.requestPointerLock?.() as unknown as Promise<void> | undefined;
- pending?.catch?.((error: unknown) => console.warn("mouse steering unavailable", error));
+ const pending = canvas.requestPointerLock() as unknown as Promise<void> | undefined;
+ pending?.catch?.(refused);
} catch (error) {
- console.warn("mouse steering unavailable", error);
+ refused(error);
}
};
+ const point = (event: PointerEvent) => {
+ const r = canvas.getBoundingClientRect();
+ if (r.width <= 0 || r.height <= 0) return;
+ cursor.current = { x: ((event.clientX - r.left) / r.width) * 2 - 1, y: 1 - ((event.clientY - r.top) / r.height) * 2 };
+ };
+ const leave = () => { cursor.current = null; };
const move = (event: MouseEvent) => {
if (document.pointerLockElement !== canvas) return;
- mouse.current.x += event.movementX;
- mouse.current.y += event.movementY;
+ const s = state.current;
+ // Moving the mouse during the landing assist takes the ship back, aiming from where it points now.
+ if (s.autopilot) { s.autopilot = null; Object.assign(aim.current, aimFromForward(forwardOf(s.q))); }
+ moveAim(aim.current, event.movementX, event.movementY, useCourier.getState().invertPitch);
+ };
+ const lockChange = () => {
+ const locked = document.pointerLockElement === canvas;
+ // The aim starts where the nose points.
+ if (locked) Object.assign(aim.current, aimFromForward(forwardOf(state.current.q)));
+ useCourier.getState().set(locked ? { mouseLocked: true, cursorAim: false } : { mouseLocked: false });
};
- const lockChange = () => useCourier.getState().set({ mouseLocked: document.pointerLockElement === canvas });
canvas.addEventListener("click", capture);
+ canvas.addEventListener("pointermove", point);
+ canvas.addEventListener("pointerleave", leave);
window.addEventListener("mousemove", move);
document.addEventListener("pointerlockchange", lockChange);
window.addEventListener("keydown", down, true);
@@ -478,11 +503,13 @@ function Courier({ layout, pad, reduced, awake }: { layout: OfficeLayout; pad: S
pressHandler.current = press;
return () => {
canvas.removeEventListener("click", capture);
+ canvas.removeEventListener("pointermove", point);
+ canvas.removeEventListener("pointerleave", leave);
window.removeEventListener("mousemove", move);
document.removeEventListener("pointerlockchange", lockChange);
if (document.pointerLockElement === canvas) document.exitPointerLock();
- mouse.current.x = 0; mouse.current.y = 0;
- useCourier.getState().set({ mouseLocked: false });
+ cursor.current = null;
+ useCourier.getState().set({ mouseLocked: false, cursorAim: false });
window.removeEventListener("keydown", down, true);
window.removeEventListener("keyup", up, true);
window.removeEventListener("blur", blur);
@@ -532,11 +559,17 @@ function Courier({ layout, pad, reduced, awake }: { layout: OfficeLayout; pad: S
}
}
const input = store.settingsOpen ? { ...NO_INPUT } : flightInput(held.current, store.bindings, gamepad, store.invertPitch);
- // The mouse adds to the keys: sideways turns, up lifts the nose, down dips it.
- const m = mouse.current;
- addMouse(input, m, store.invertPitch);
- const springBack = Math.exp(-10 * dt);
- m.x *= springBack; m.y *= springBack;
+ if (store.mouseLocked || store.cursorAim) {
+ // Mouse aim: the turn and pitch keys move the aim too, and the ship flies to wherever it points.
+ const a = aim.current;
+ if (s.landed || s.autopilot) Object.assign(a, aimFromForward(forwardOf(s.q)));
+ else {
+ if (!store.mouseLocked && cursor.current && !store.settingsOpen) cursorTurn(a, cursor.current.x, cursor.current.y, dt);
+ moveAim(a, input.yaw * 600 * dt, -input.pitch * 450 * dt, false);
+ input.yaw = 0; input.pitch = 0;
+ steerTowards(input, s.q, aimDirection(a, aimDir));
+ }
+ }
stepFlight(s, input, dt, store.assist, world, home);
if (s.impact > lastImpact.current + 6 && sound.current) sound.current.impact(s.impact);
lastImpact.current = s.impact;
@@ -594,8 +627,9 @@ function Courier({ layout, pad, reduced, awake }: { layout: OfficeLayout; pad: S
// The chase camera starts from here when the pilot switches back.
camPos.current.copy(camera.position);
} else {
- // Behind the tail and above it, looking past the nose.
- const want = _v.a.copy(s.p).addScaledVector(f, -CHASE.back).add(_v.b.set(0, CHASE.up, 0));
+ // Behind the tail and above it, looking past the nose; with mouse aim, looking where the pilot aims.
+ const look = (store.mouseLocked || store.cursorAim) && !s.landed && !s.autopilot ? aimDirection(aim.current, aimDir) : f;
+ const want = _v.a.copy(s.p).addScaledVector(look, -CHASE.back).add(_v.b.set(0, CHASE.up, 0));
// Never through a tower: pull in to just short of whatever stands between the ship and the camera.
const from = _v.b.copy(s.p).add(_v.c.set(0, 2, 0));
const dir = _v.c.copy(want).sub(from);
@@ -606,8 +640,9 @@ function Courier({ layout, pad, reduced, awake }: { layout: OfficeLayout; pad: S
camPos.current.lerp(want, 1 - Math.exp(-CHASE.stiffness * dt));
camera.position.copy(camPos.current);
camera.up.set(0, 1, 0);
- camera.lookAt(_v.b.copy(s.p).addScaledVector(f, CHASE.lookAhead).addScaledVector(u, 1.5));
+ camera.lookAt(_v.b.copy(s.p).addScaledVector(look, CHASE.lookAhead).addScaledVector(u, 1.5));
}
+ placeMarkers();
// The listener's own speed, for the Doppler shift: measured before any shake.
camVel.current.copy(camera.position).sub(camPrev.current).divideScalar(Math.max(dt, 1e-3));
camPrev.current.copy(camera.position);
@@ -621,6 +656,22 @@ function Courier({ layout, pad, reduced, awake }: { layout: OfficeLayout; pad: S
camera.updateProjectionMatrix();
}
+ /** The aim reticle and the nose marker on the HUD: where the pilot aims, and where the nose points now. */
+ function placeMarkers() {
+ const s = state.current, store = useCourier.getState();
+ const show = (store.mouseLocked || store.cursorAim) && !s.landed && !s.autopilot;
+ camera.updateMatrixWorld();
+ for (const [id, dir] of [["courier-aim", show ? aimDirection(aim.current, aimDir) : null], ["courier-nose", show ? forwardOf(s.q, _v.c) : null]] as const) {
+ const el = document.getElementById(id);
+ if (!el) continue;
+ if (!dir) { el.style.opacity = "0"; continue; }
+ const ndc = _v.a.copy(s.p).addScaledVector(dir, 220).project(camera);
+ el.style.opacity = ndc.z < 1 ? "1" : "0";
+ el.style.left = `${((ndc.x + 1) / 2) * 100}%`;
+ el.style.top = `${((1 - ndc.y) / 2) * 100}%`;
+ }
+ }
+
function updateTrails(dt: number) {
const s = state.current;
const strength = Math.max(0, Math.min(1, (s.v.length() - FLIGHT.cruise * 0.6) / (FLIGHT.cruise * 0.6)));
diff --git a/jarvis/ui/web/frontend/src/components/society/office/courierControls.ts b/jarvis/ui/web/frontend/src/components/society/office/courierControls.ts
index 7a95ff0806..72e879c3a8 100644
--- a/jarvis/ui/web/frontend/src/components/society/office/courierControls.ts
+++ b/jarvis/ui/web/frontend/src/components/society/office/courierControls.ts
@@ -3,6 +3,7 @@
* pilot's own rebinding (kept in this browser), and how held keys and a
* gamepad become one FlightInput. Pure and tested.
*/
+import { Quaternion, Vector3 } from "three";
import type { FlightInput } from "./courierFlight";
export const FLIGHT_ACTIONS = [
@@ -117,16 +118,61 @@ export function flightInput(held: ReadonlySet<string>, bindings: FlightBindings,
/** Gamepad buttons that fire a press action: X lands, Y switches the camera, Back the assist, Start leaves the ship. */
export const PAD_PRESSES: readonly [number, FlightAction][] = [[2, "land"], [3, "camera"], [8, "assist"], [9, "exit"]];
-/** Stick travel per pixel of captured mouse movement. */
-export const MOUSE_GAIN = 0.02;
+/**
+ * Mouse aim. With the mouse captured, moving it moves where the pilot aims (a direction in the world, shown as a
+ * reticle), and the ship keeps turning towards that aim by itself until its nose is on it, whether or not the
+ * mouse is still moving. Yaw 0 looks along -z and grows towards -x; pitch is up from the horizon.
+ */
+export interface MouseAim { yaw: number; pitch: number }
+
+/** Radians of aim per pixel of mouse movement, and the steepest aim up or down. */
+export const AIM_PER_PIXEL = 0.0024;
+const AIM_PITCH_LIMIT = 1.4;
+/** How hard the ship steers towards the aim: stick per radian of error. */
+const AIM_GAIN = 2.6;
+
+export function aimFromForward(forward: Vector3): MouseAim {
+ return { yaw: Math.atan2(-forward.x, -forward.z), pitch: Math.asin(Math.max(-1, Math.min(1, forward.y))) };
+}
+
+export function aimDirection(aim: MouseAim, out = new Vector3()): Vector3 {
+ const c = Math.cos(aim.pitch);
+ return out.set(-Math.sin(aim.yaw) * c, Math.sin(aim.pitch), -Math.cos(aim.yaw) * c);
+}
+
+/** Move the aim by a mouse movement (pixels, browser axes: +y is down): up aims higher, right aims right. */
+export function moveAim(aim: MouseAim, dx: number, dy: number, invertPitch: boolean): MouseAim {
+ aim.yaw -= dx * AIM_PER_PIXEL;
+ aim.pitch = Math.max(-AIM_PITCH_LIMIT, Math.min(AIM_PITCH_LIMIT, aim.pitch + (invertPitch ? dy : -dy) * AIM_PER_PIXEL));
+ return aim;
+}
+
+/** Turn rate of the aim with the cursor at the edge of the view, and the still zone around its middle. */
+const CURSOR_TURN_RATE = 1.8;
+const CURSOR_DEAD_ZONE = 0.08;
/**
- * Captured mouse movement (pixels, browser axes: +y is down) added to an input: moving the mouse sideways turns,
- * moving it up lifts the nose and down dips it (the other way round with inverted pitch).
+ * Cursor steering, for when the view cannot capture the mouse: the cursor's place in the view (-1..1 from the middle,
+ * +y up) turns the aim at a rate that grows towards the edge, and keeps turning while the cursor rests there.
*/
-export function addMouse(input: FlightInput, mouse: { x: number; y: number }, invertPitch: boolean): FlightInput {
+export function cursorTurn(aim: MouseAim, x: number, y: number, dt: number): MouseAim {
+ const shape = (v: number) => {
+ const m = Math.max(0, Math.min(1, (Math.abs(v) - CURSOR_DEAD_ZONE) / (1 - CURSOR_DEAD_ZONE)));
+ return Math.sign(v) * m * m;
+ };
+ aim.yaw -= shape(x) * CURSOR_TURN_RATE * dt;
+ aim.pitch = Math.max(-AIM_PITCH_LIMIT, Math.min(AIM_PITCH_LIMIT, aim.pitch + shape(y) * CURSOR_TURN_RATE * dt));
+ return aim;
+}
+
+const _local = new Vector3();
+const _inverse = new Quaternion();
+
+/** The pitch and yaw that turn a ship of orientation q towards direction dir, added to the input. */
+export function steerTowards(input: FlightInput, q: Quaternion, dir: Vector3): FlightInput {
+ const local = _local.copy(dir).applyQuaternion(_inverse.copy(q).invert());
const clamp = (v: number) => Math.max(-1, Math.min(1, v));
- input.yaw = clamp(input.yaw + mouse.x * MOUSE_GAIN);
- input.pitch = clamp(input.pitch + (invertPitch ? mouse.y : -mouse.y) * MOUSE_GAIN);
+ input.yaw = clamp(input.yaw + Math.atan2(local.x, -local.z) * AIM_GAIN);
+ input.pitch = clamp(input.pitch + Math.atan2(local.y, Math.hypot(local.x, local.z)) * AIM_GAIN);
return input;
}
diff --git a/jarvis/ui/web/frontend/src/components/society/office/courierFlight.test.ts b/jarvis/ui/web/frontend/src/components/society/office/courierFlight.test.ts
index 1641fc0756..da1ea70cfb 100644
--- a/jarvis/ui/web/frontend/src/components/society/office/courierFlight.test.ts
+++ b/jarvis/ui/web/frontend/src/components/society/office/courierFlight.test.ts
@@ -1,7 +1,7 @@
import { describe, expect, it } from "vitest";
import { Vector3 } from "three";
import { GROUND_Y, planCity } from "./cityPlan";
-import { addMouse, DEFAULT_BINDINGS, flightInput, keyLabel, loadBindings, rebind, saveBindings } from "./courierControls";
+import { aimDirection, aimFromForward, cursorTurn, DEFAULT_BINDINGS, flightInput, keyLabel, loadBindings, moveAim, rebind, saveBindings, steerTowards } from "./courierControls";
import { engageAutopilot, FLIGHT, forwardOf, NO_INPUT, parkedState, stepFlight, type FlightInput, type FlightState } from "./courierFlight";
import { buildCourierWorld, rayDistance, sphereContact } from "./courierWorld";
import { buildOfficeLayout } from "./officeLayout";
@@ -212,18 +212,37 @@ describe("the courier's controls", () => {
expect(flightInput(new Set(), DEFAULT_BINDINGS, { axes: [0.1, -0.1, 0, 0], buttons: [] }, false).yaw).toBe(0);
});
- it("turns the mouse into a stick: up lifts the nose, down dips it, sideways turns", () => {
- const up = addMouse({ ...NO_INPUT }, { x: 0, y: -20 }, false);
- expect(up.pitch).toBeGreaterThan(0.3);
- expect(addMouse({ ...NO_INPUT }, { x: 0, y: 20 }, false).pitch).toBeLessThan(-0.3);
- expect(addMouse({ ...NO_INPUT }, { x: 0, y: -20 }, true).pitch).toBeLessThan(-0.3);
- expect(addMouse({ ...NO_INPUT }, { x: 30, y: 0 }, false).yaw).toBeGreaterThan(0.3);
- // And a mouse moved up for a moment really brings the nose up in flight.
+ it("aims with the mouse: the ship turns to the aim and keeps flying there after the mouse stops", () => {
const s = parkedState(home);
fly(s, { lift: 1 }, 2);
fly(s, { throttle: 1 }, 2);
- for (let i = 0; i < 40; i += 1) stepFlight(s, addMouse({ ...NO_INPUT }, { x: 0, y: -30 }, false), 1 / 60, "arcade", world, home);
- expect(forwardOf(s.q).y).toBeGreaterThan(0.4);
+ const aim = aimFromForward(forwardOf(s.q));
+ // One short flick of the mouse up and to the right, then nothing more.
+ moveAim(aim, 260, -180, false);
+ const target = aimDirection(aim);
+ for (let i = 0; i < 60 * 3; i += 1) stepFlight(s, steerTowards({ ...NO_INPUT }, s.q, target), 1 / 60, "arcade", world, home);
+ // The nose came round onto the aim by itself: up and to the right.
+ expect(forwardOf(s.q).angleTo(target)).toBeLessThan(0.12);
+ expect(forwardOf(s.q).y).toBeGreaterThan(0.3);
+ // And the velocity followed it.
+ expect(s.v.clone().normalize().angleTo(target)).toBeLessThan(0.25);
+ // Inverted pitch aims the other way.
+ expect(moveAim({ yaw: 0, pitch: 0 }, 0, -100, true).pitch).toBeLessThan(0);
+ });
+
+ it("steers with the cursor when the mouse cannot be captured: a resting cursor off the middle keeps turning", () => {
+ // In the still zone nothing turns.
+ expect(cursorTurn({ yaw: 0, pitch: 0 }, 0.05, -0.05, 1)).toEqual({ yaw: 0, pitch: 0 });
+ // Right of the middle turns right (yaw falls), above it pitches up, and each frame adds the same again.
+ const aim = { yaw: 0, pitch: 0 };
+ for (let i = 0; i < 30; i += 1) cursorTurn(aim, 0.6, 0.4, 1 / 60);
+ const half = { ...aim };
+ for (let i = 0; i < 30; i += 1) cursorTurn(aim, 0.6, 0.4, 1 / 60);
+ expect(half.yaw).toBeLessThan(0);
+ expect(half.pitch).toBeGreaterThan(0);
+ expect(aim.yaw).toBeCloseTo(half.yaw * 2, 6);
+ // Further out turns faster.
+ expect(Math.abs(cursorTurn({ yaw: 0, pitch: 0 }, 1, 0, 1).yaw)).toBeGreaterThan(Math.abs(cursorTurn({ yaw: 0, pitch: 0 }, 0.5, 0, 1).yaw));
});
it("rebinds a key to one action and remembers it", () => {
diff --git a/jarvis/ui/web/frontend/src/components/society/office/courierHud.css b/jarvis/ui/web/frontend/src/components/society/office/courierHud.css
index 305bddef09..3215f5452f 100644
--- a/jarvis/ui/web/frontend/src/components/society/office/courierHud.css
+++ b/jarvis/ui/web/frontend/src/components/society/office/courierHud.css
@@ -28,3 +28,10 @@
.courier-binding { display:flex; justify-content:space-between; align-items:center; gap:10px; }
.courier-binding span { color:hsl(var(--muted-foreground)); }
@media (max-width:600px) { .courier-hud { bottom:10px; gap:8px; } .courier-help { display:none; } }
+/* Mouse aim: a ring where the pilot aims, a small dot where the nose points (both placed by the scene). */
+.courier-aim, .courier-nose { position:absolute; z-index:39; pointer-events:none; opacity:0; transform:translate(-50%, -50%); }
+.courier-aim { width:34px; height:34px; border-radius:50%; border:2px solid hsl(var(--primary) / .9); box-shadow:0 0 0 1px hsl(var(--background) / .6); }
+.courier-aim::before, .courier-aim::after { content:""; position:absolute; left:50%; top:50%; background:hsl(var(--primary) / .9); transform:translate(-50%, -50%); }
+.courier-aim::before { width:2px; height:8px; }
+.courier-aim::after { width:8px; height:2px; }
+.courier-nose { width:10px; height:10px; border-radius:50%; background:hsl(var(--foreground) / .85); box-shadow:0 0 0 2px hsl(var(--background) / .6); }
diff --git a/jarvis/ui/web/frontend/src/components/society/office/courierStore.ts b/jarvis/ui/web/frontend/src/components/society/office/courierStore.ts
index 9a54037761..e2819b9c7f 100644
--- a/jarvis/ui/web/frontend/src/components/society/office/courierStore.ts
+++ b/jarvis/ui/web/frontend/src/components/society/office/courierStore.ts
@@ -65,6 +65,8 @@ interface CourierState extends CourierPrefs {
settingsOpen: boolean;
/** The mouse is captured for steering. */
mouseLocked: boolean;
+ /** The view refused to capture the mouse, so the visible cursor steers instead: its offset from the middle turns the aim. */
+ cursorAim: boolean;
telemetry: CourierTelemetry;
/** Bumped when the pilot asks for the landing assist, or to step out, from the HUD (the keys act in the scene). */
landRequest: number;
@@ -73,7 +75,7 @@ interface CourierState extends CourierPrefs {
disembark: () => void;
setPrefs: (patch: Partial<CourierPrefs>) => void;
setBindings: (bindings: FlightBindings) => void;
- set: (patch: Partial<Pick<CourierState, "helpOpen" | "settingsOpen" | "telemetry" | "mouseLocked">>) => void;
+ set: (patch: Partial<Pick<CourierState, "helpOpen" | "settingsOpen" | "telemetry" | "mouseLocked" | "cursorAim">>) => void;
requestLanding: () => void;
requestExit: () => void;
setReady: (ready: boolean) => void;
@@ -89,6 +91,7 @@ export const useCourier = create<CourierState>((set, get) => ({
helpOpen: false,
settingsOpen: false,
mouseLocked: false,
+ cursorAim: false,
telemetry: IDLE,
landRequest: 0,
exitRequest: 0,
diff --git a/jarvis/ui/web/frontend/src/i18n/locales/society/de.json b/jarvis/ui/web/frontend/src/i18n/locales/society/de.json
index a940fb72bb..1995bb825f 100644
--- a/jarvis/ui/web/frontend/src/i18n/locales/society/de.json
+++ b/jarvis/ui/web/frontend/src/i18n/locales/society/de.json
@@ -1628,7 +1628,8 @@
"flight_action_exit": "Aussteigen (gelandet)",
"flight_action_help": "Steuerung zeigen",
"flight_mouse_hint": "Ins Bild klicken, um mit der Maus zu steuern.",
- "flight_mouse_on": "Maussteuerung an: bewegen zum Drehen und Nicken. Esc gibt sie frei."
+ "flight_mouse_on": "Mauszielen an: Die Maus bewegt den Ring, das Schiff fliegt selbst dorthin. Esc gibt sie frei.",
+ "flight_mouse_cursor": "Zeigersteuerung: Zeiger von der Bildmitte wegbewegen zum Drehen; bleibt er dort, dreht das Schiff weiter."
},
"arcade": {
"play_prompt": "{0} spielen",
diff --git a/jarvis/ui/web/frontend/src/i18n/locales/society/en.json b/jarvis/ui/web/frontend/src/i18n/locales/society/en.json
index e1dd2bcb37..080f4cff49 100644
--- a/jarvis/ui/web/frontend/src/i18n/locales/society/en.json
+++ b/jarvis/ui/web/frontend/src/i18n/locales/society/en.json
@@ -1628,7 +1628,8 @@
"flight_action_exit": "Step out (landed)",
"flight_action_help": "Show the controls",
"flight_mouse_hint": "Click the view to steer with the mouse.",
- "flight_mouse_on": "Mouse steering on: move to turn and pitch. Esc lets go."
+ "flight_mouse_on": "Mouse aim on: the mouse moves the ring, the ship flies there by itself. Esc lets go.",
+ "flight_mouse_cursor": "Cursor steering: move the cursor away from the middle to turn; resting there keeps turning."
},
"arcade": {
"play_prompt": "Play {0}",
diff --git a/jarvis/ui/web/frontend/src/i18n/locales/society/es.json b/jarvis/ui/web/frontend/src/i18n/locales/society/es.json
index 957e1b720b..5721dc5d9a 100644
--- a/jarvis/ui/web/frontend/src/i18n/locales/society/es.json
+++ b/jarvis/ui/web/frontend/src/i18n/locales/society/es.json
@@ -1628,7 +1628,8 @@
"flight_action_exit": "Bajar (aterrizada)",
"flight_action_help": "Mostrar controles",
"flight_mouse_hint": "Haz clic en la vista para pilotar con el ratón.",
- "flight_mouse_on": "Ratón activo: muévelo para girar y cabecear. Esc lo suelta."
+ "flight_mouse_on": "Apuntado con ratón: el ratón mueve el anillo y la nave vuela hacia él sola. Esc lo suelta.",
+ "flight_mouse_cursor": "Control con el cursor: aléjalo del centro para girar; si se queda ahí, sigue girando."
},
"arcade": {
"play_prompt": "Jugar a {0}",
diff --git a/jarvis/ui/web/frontend/src/i18n/locales/society/pt.json b/jarvis/ui/web/frontend/src/i18n/locales/society/pt.json
index f394ec05b5..27d692e9cc 100644
--- a/jarvis/ui/web/frontend/src/i18n/locales/society/pt.json
+++ b/jarvis/ui/web/frontend/src/i18n/locales/society/pt.json
@@ -1628,7 +1628,8 @@
"flight_action_exit": "Sair (aterrada)",
"flight_action_help": "Mostrar controlos",
"flight_mouse_hint": "Clique na vista para pilotar com o rato.",
- "flight_mouse_on": "Rato ativo: mova para virar e arfar. Esc liberta-o."
+ "flight_mouse_on": "Mira com o rato: o rato move o anel e a nave voa até lá sozinha. Esc liberta-o.",
+ "flight_mouse_cursor": "Controlo pelo cursor: afaste-o do centro para virar; se ficar lá, continua a virar."
},
"arcade": {
"play_prompt": "Jogar {0}",
diff --git a/jarvis/ui/web/frontend/src/i18n/locales/society/zh.json b/jarvis/ui/web/frontend/src/i18n/locales/society/zh.json
index f6ba85f55d..3897a50b0f 100644
--- a/jarvis/ui/web/frontend/src/i18n/locales/society/zh.json
+++ b/jarvis/ui/web/frontend/src/i18n/locales/society/zh.json
@@ -1628,7 +1628,8 @@
"flight_action_exit": "下船(已降落)",
"flight_action_help": "显示操作",
"flight_mouse_hint": "点击画面即可用鼠标操控。",
- "flight_mouse_on": "鼠标操控已开启:移动鼠标转向和俯仰,按 Esc 释放。"
+ "flight_mouse_on": "鼠标瞄准已开启:鼠标移动圆环,飞船会自动飞向那里。按 Esc 释放。",
+ "flight_mouse_cursor": "光标操控:将光标移离画面中心即可转向;停在那里会持续转向。"
},
"arcade": {
"play_prompt": "玩 {0}",