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
+33
View File
@@ -11,6 +11,12 @@ pub(super) fn method_signature(
use Operation::*;
let nominal = |name| desktop_type(store, name, desktop).map(Nominal);
let (arguments, returns, effect) = match operation {
Translate3D | Rotate3D => (vec![Number, Number, Number], Unit, CallEffect::Mutating),
CameraControl => (
vec![nominal("Object")?, nominal("CameraGesture")?],
Unit,
CallEffect::Mutating,
),
Bind => (
vec![TextType, Function],
nominal("Subscription")?,
@@ -152,6 +158,33 @@ pub(super) fn operation_signature(
CallEffect::ReadOnly,
),
Page => (vec![], None, nominal("Page")?, CallEffect::ReadOnly),
Viewport3D => (
vec![Number, Number, nominal("Scene3D")?],
None,
nominal("Viewport3D")?,
CallEffect::ReadOnly,
),
SceneObject(kind) => {
let parameters = kind
.parameters()
.iter()
.map(|name| match *name {
"Number" => Ok(Number),
"String" => Ok(TextType),
name => nominal(name),
})
.collect::<Result<Vec<_>, VmError>>()?;
(
parameters,
if kind.variadic() {
Some(nominal("Object")?)
} else {
None
},
nominal(kind.name())?,
CallEffect::ReadOnly,
)
}
Scene2D => (
vec![],
Some(nominal("Block")?),