feat: render programmable 3d scenes cameras and picking
This commit is contained in:
@@ -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, .. } => {
|
||||
|
||||
Reference in New Issue
Block a user