Add session-only anchored overlay resize grip

This commit is contained in:
baketnk committed 2026-09-24 15:50:55 -04:00
1 parent 468d3e9b63
commit 19a3db7667
9 files changed
+94 -11

No files matched your search

+13
View File
@@ -65,6 +65,19 @@ int main() {
const auto head = relative_mount_pose(Mount::Head);
check_basis(head, 1, 0, 0, 1);
CHECK(near(head[0][3], 0)); CHECK(near(head[1][3], -.16f)); CHECK(near(head[2][3], -1.05f));
for (auto mount : mounts) {
const float width = mount_width(mount);
const auto original = mount == Mount::World ? identity : relative_mount_pose(mount);
const auto grown = resized_mount_pose(original, width, 1.5f, .68f);
const auto shrunk = resized_mount_pose(original, width, .5f, .68f);
CHECK(resized_mount_pose(original, width, 1.f, .68f) == original);
for (int row = 0; row < 3; ++row) {
// Upper-left = center - width/2 * right + height/2 * up.
const float old_corner = original[row][3] - width * .5f * original[row][0] + width * .34f * original[row][1];
CHECK(near(grown[row][3] - width * .75f * grown[row][0] + width * .51f * grown[row][1], old_corner));
CHECK(near(shrunk[row][3] - width * .25f * shrunk[row][0] + width * .17f * shrunk[row][1], old_corner));
}
}
const auto left = relative_mount_pose(Mount::LeftWrist), right = relative_mount_pose(Mount::RightWrist);
check_basis(right, 0, 1, -1, 0); // right wrist faces inward, not away from wearer
for (int r = 0; r < 3; ++r) {
+13
View File
@@ -61,6 +61,19 @@ int main(int argc, char** argv) {
no_action(click(surface, std::numeric_limits<float>::quiet_NaN(), 610));
no_action(click(surface, -1, 610));
no_action(click(surface, 1000, 680));
// Lower-right grip scales without activating the nearby Quit button or
// uploading new pixels. Other cursors cannot hijack an active drag.
surface.pointer_down(0, 951, 656);
assert(!surface.pointer_move(1, 970, 650));
auto factor = surface.pointer_move(0, 971, 641);
assert(factor && *factor > 1.f);
no_action(surface.pointer_up(0, 900, 610));
assert(!surface.pointer_move(0, 975, 640));
assert(!surface.render(p));
surface.pointer_down(0, 951, 656);
surface.reset_pointers();
assert(!surface.pointer_move(0, 971, 641));
no_action(surface.pointer_up(0, 951, 656));
p.enabled = true;
p.record_available = false;