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
+7
View File
@@ -31,6 +31,10 @@ impl Color {
#[derive(Clone, Debug)]
pub enum DrawCommand {
Scene3D {
rect: Rect,
view: std::sync::Arc<crate::scene3d::View>,
},
Clear(Color),
PushClip(Rect),
PopClip,
@@ -63,6 +67,7 @@ impl DrawCommand {
pub fn translated(mut self, delta: Point) -> Self {
match &mut self {
Self::WrappedText { rect, .. }
| Self::Scene3D { rect, .. }
| Self::PushClip(rect)
| Self::FillRoundedRect { rect, .. }
| Self::StrokeRoundedRect { rect, .. } => {
@@ -93,6 +98,7 @@ impl DisplayList {
Some(rect)
}
DrawCommand::PushClip(rect) => Some(rect),
DrawCommand::Scene3D { rect, .. } => Some(rect),
DrawCommand::FillRoundedRect { rect, radius, .. } => {
*radius *= scale;
Some(rect)
@@ -131,6 +137,7 @@ impl DisplayList {
for command in &mut self.commands {
match command {
DrawCommand::WrappedText { rect, .. }
| DrawCommand::Scene3D { rect, .. }
| DrawCommand::PushClip(rect)
| DrawCommand::FillRoundedRect { rect, .. }
| DrawCommand::StrokeRoundedRect { rect, .. } => {