feat: compose interactive world ui across nested 3d viewports

This commit is contained in:
2026-11-11 00:08:23 +08:00
parent ad2c01bc29
commit 15fc01542c
27 changed files with 1412 additions and 84 deletions
+18 -4
View File
@@ -479,10 +479,12 @@ impl Worker {
let point = crate::geometry::Point::new(point[0], point[1]);
mount.contains(point)
&& mount.viewport_clip.is_some_and(|clip| {
point.x >= clip[0]
&& point.y >= clip[1]
&& point.x < clip[0] + clip[2]
&& point.y < clip[1] + clip[3]
mount.view_point(point, true).is_some_and(|point| {
point.x >= clip[0]
&& point.y >= clip[1]
&& point.x < clip[0] + clip[2]
&& point.y < clip[1] + clip[3]
})
})
})
})
@@ -492,6 +494,18 @@ impl Worker {
"zoom anchor is outside content viewport",
));
}
if (input.kind.starts_with("viewport-") || input.kind.starts_with("scene-"))
&& input.point.is_none()
&& frame
.mounts
.iter()
.any(|mount| mount.id == input.mount && mount.panel.is_some())
{
return RequestProgress::Complete(error_response(
StatusCode(400),
"world-space UI camera input requires a pointer",
));
}
Some(input)
} else {
None