ModelViewer builder
A bounded viewer for one 3D model.
A builder is RenderOnce. Construct and mount it in one expression.
use gpui_kit::media::ModelViewer;
Construct
new(ident: impl Into<Ident>) -> SelfOptions
Chain onto the value.
title(title: impl Into<SharedString>) -> Self
state(state: ModelState) -> Self
scene(scene: Rc<ModelScene>) -> Self
rejected(error: ModelError) -> Self
loading() -> Self
shading(shading: ModelShading) -> Self
orbit(yaw: f32, pitch: f32) -> Self
height(height: f32) -> Self
on_event(handler: impl Fn(&ModelViewerEvent, &mut Window, &mut App) + 'static) -> SelfReports
The variants of the event it emits. It never applies the change itself.
- OrbitChanged
- ShadingChanged
Rendered by
Each of these compiles and is captured by the gate, so the code behind them is verified rather than written.