GPUI Box GitHub

Components

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>) -> Self

Options

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) -> Self

Reports

The variants of the event it emits. It never applies the change itself.

Rendered by

Each of these compiles and is captured by the gate, so the code behind them is verified rather than written.

Source: crates/gpui-kit/src/media/model_viewer.rs