feat: render programmable 3d scenes cameras and picking

This commit is contained in:
2026-11-10 23:19:26 +08:00
parent 040b779f5f
commit ad2c01bc29
33 changed files with 2463 additions and 42 deletions
+8 -1
View File
@@ -232,6 +232,13 @@ pub fn project(
(mount.width - inset.horizontal()).max(0.0),
(mount.height - inset.vertical()).max(0.0),
))
} else if matches!(node.kind, UiKind::Viewport3D { .. }) {
Some(Rect::new(
mount.x + inset.left,
mount.y + inset.top,
(mount.width - inset.horizontal()).max(0.),
(mount.height - inset.vertical()).max(0.),
))
} else if node.clip_children {
let border = node.border;
Some(Rect::new(
@@ -249,7 +256,7 @@ pub fn project(
let rect = view.rect(rect);
let rect = [rect.x, rect.y, rect.width, rect.height];
child_clip = Some(clip.map_or(rect, |clip| intersect(clip, rect)));
if mount.canvas_viewport {
if mount.canvas_viewport || mount.scene3d_viewport {
mount.viewport_clip = child_clip;
}
}