Files
mommysgoodpuppy fd19e37bbd Carry two-hand grabs in a frame spanning both controllers
A second hand dropped the window back to worker-driven motion and jumped it. Two-hand carries
now send the window relative to a frame built from both grab points (midpoint, the axis between
them, both hands' up, their distance as scale), which the renderer rebuilds from its fresh poses
of both controllers; release freezes that frame the same way. OpenVR screens attach to one
device only, so they stay absolute during a two-hand carry.

AGENTS.md now points agents at `deno task check`, which filters unrelated vendor errors.

Agent: Claude Code 2.1.296; model claude-opus-5-5; thread 941be8c7-aca1-4664-b284-7cc0eed69e21
2026-10-16 21:17:21 +03:00

31 lines
1.1 KiB
TypeScript

import { assertEquals } from "jsr:@std/assert@^1.0.0";
import { FakeTime } from "jsr:@std/testing@^1.0.0/time";
import {
requestFollowRelease,
setFollowReleaseSender,
settleFollowRelease,
} from "./controllerDeviceFrames.ts";
Deno.test("a release lands on the renderer's answer, once", () => {
let sent = -1;
setFollowReleaseSender((_carry, seq) => (sent = seq, true));
const landed: unknown[] = [];
requestFollowRelease({ space: "right-ray" }, (pose) => landed.push(pose));
settleFollowRelease(sent, [1]);
settleFollowRelease(sent, [2]);
assertEquals(landed, [[1]]);
setFollowReleaseSender(null);
});
Deno.test("a release lands unshifted without a renderer or an answer", () => {
using time = new FakeTime();
const landed: unknown[] = [];
requestFollowRelease({ space: "left-hand" }, (pose) => landed.push(pose));
assertEquals(landed, [null]);
setFollowReleaseSender(() => true);
requestFollowRelease({ space: "left-hand" }, (pose) => landed.push(pose));
time.tick(200);
assertEquals(landed, [null, null]);
setFollowReleaseSender(null);
});