pub struct ThreeViewProps {Show 42 fields
pub model_url: Option<String>,
pub format: ModelFormat,
pub pos_x: f32,
pub pos_y: f32,
pub pos_z: f32,
pub rot_x: f32,
pub rot_y: f32,
pub rot_z: f32,
pub scale: f32,
pub color: String,
pub models: Vec<ModelConfig>,
pub auto_center: bool,
pub auto_scale: bool,
pub cam_x: f32,
pub cam_y: f32,
pub cam_z: f32,
pub target_x: f32,
pub target_y: f32,
pub target_z: f32,
pub auto_rotate: bool,
pub rot_speed: f32,
pub show_grid: bool,
pub show_axes: bool,
pub background: String,
pub class: String,
pub shadows: bool,
pub wireframe: bool,
pub shader: ShaderPreset,
pub id: Option<String>,
pub raycast: RaycastConfig,
pub on_pointer_down: Option<Callback<PointerEvent>>,
pub on_pointer_up: Option<Callback<PointerEvent>>,
pub on_pointer_move: Option<Callback<PointerEvent>>,
pub on_pointer_drag: Option<Callback<PointerDragEvent>>,
pub on_gesture: Option<Callback<GestureEvent>>,
pub selection: Option<Selection>,
pub selection_mode: SelectionMode,
pub selection_style: SelectionStyle,
pub on_selection_change: Option<Callback<Selection>>,
pub gizmo: Option<Gizmo>,
pub on_gizmo_drag: Option<Callback<GizmoEvent>>,
pub debug: bool,
}Expand description
Properties for the ThreeView component
Fields§
§model_url: Option<String>Model file path or URL (optional - uses cube if not provided)
format: ModelFormatModel format
pos_x: f32Model position X
pos_y: f32Model position Y
pos_z: f32Model position Z
rot_x: f32Model rotation X (degrees)
rot_y: f32Model rotation Y (degrees)
rot_z: f32Model rotation Z (degrees)
scale: f32Model scale
color: StringModel color/material (hex string like “#ff6b6b”)
models: Vec<ModelConfig>Multiple models to load (optional - if set, model_url/format are ignored)
auto_center: boolAuto-center the model
auto_scale: boolAuto-scale to fit viewport
cam_x: f32Camera position X
cam_y: f32Camera position Y
cam_z: f32Camera position Z
target_x: f32Camera target X
target_y: f32Camera target Y
target_z: f32Camera target Z
auto_rotate: boolAuto-rotate the model
rot_speed: f32Auto-rotation speed
show_grid: boolShow grid helper
show_axes: boolShow axes helper
background: StringBackground color
class: StringAdditional CSS class for the container
shadows: boolEnable shadows
wireframe: boolWireframe mode
shader: ShaderPresetShader preset or custom shader
id: Option<String>Unique ID for this view (needed for pointer event routing)
raycast: RaycastConfigRaycast configuration
on_pointer_down: Option<Callback<PointerEvent>>Callback for pointer down events
on_pointer_up: Option<Callback<PointerEvent>>Callback for pointer up events
on_pointer_move: Option<Callback<PointerEvent>>Callback for pointer move events (hover)
on_pointer_drag: Option<Callback<PointerDragEvent>>Callback for pointer drag events
on_gesture: Option<Callback<GestureEvent>>Callback for gesture events (pinch, rotate, pan)
selection: Option<Selection>Current selection state
selection_mode: SelectionModeSelection mode
selection_style: SelectionStyleVisual style for selection
on_selection_change: Option<Callback<Selection>>Callback when selection changes
gizmo: Option<Gizmo>Gizmo configuration for transform manipulation
on_gizmo_drag: Option<Callback<GizmoEvent>>Callback during gizmo drag
debug: boolEnable debug overlay
Implementations§
Source§impl ThreeViewProps
impl ThreeViewProps
Sourcepub fn builder() -> ThreeViewPropsBuilder<((), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), ())>
pub fn builder() -> ThreeViewPropsBuilder<((), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), ())>
Create a builder for building ThreeViewProps.
On the builder, call .model_url(...)(optional), .format(...)(optional), .pos_x(...)(optional), .pos_y(...)(optional), .pos_z(...)(optional), .rot_x(...)(optional), .rot_y(...)(optional), .rot_z(...)(optional), .scale(...)(optional), .color(...)(optional), .models(...)(optional), .auto_center(...)(optional), .auto_scale(...)(optional), .cam_x(...)(optional), .cam_y(...)(optional), .cam_z(...)(optional), .target_x(...)(optional), .target_y(...)(optional), .target_z(...)(optional), .auto_rotate(...)(optional), .rot_speed(...)(optional), .show_grid(...)(optional), .show_axes(...)(optional), .background(...)(optional), .class(...)(optional), .shadows(...)(optional), .wireframe(...)(optional), .shader(...)(optional), .id(...)(optional), .raycast(...)(optional), .on_pointer_down(...)(optional), .on_pointer_up(...)(optional), .on_pointer_move(...)(optional), .on_pointer_drag(...)(optional), .on_gesture(...)(optional), .selection(...)(optional), .selection_mode(...)(optional), .selection_style(...)(optional), .on_selection_change(...)(optional), .gizmo(...)(optional), .on_gizmo_drag(...)(optional), .debug(...)(optional) to set the values of the fields.
Finally, call .build() to create the instance of ThreeViewProps.
Trait Implementations§
Source§impl Clone for ThreeViewProps
impl Clone for ThreeViewProps
Source§fn clone(&self) -> ThreeViewProps
fn clone(&self) -> ThreeViewProps
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more