pub struct Viewport {Show 17 fields
pub layout: ViewportLayout,
pub panels: Vec<ViewportPanel>,
pub active_panel: usize,
pub total_width: f32,
pub total_height: f32,
pub grid: GridSettings,
pub selection_outline: SelectionOutline,
pub selected_entities: Vec<EntityId>,
pub gizmo_mode: GizmoMode,
pub gizmo_space: GizmoSpace,
pub entities: HashMap<EntityId, ViewportEntity>,
pub lights: Vec<LightData>,
pub show_stats: bool,
pub show_fps: bool,
pub show_camera_info: bool,
pub playback_time: f32,
pub is_playing: bool,
/* private fields */
}Fields§
§layout: ViewportLayout§panels: Vec<ViewportPanel>§active_panel: usize§total_width: f32§total_height: f32§grid: GridSettings§selection_outline: SelectionOutline§selected_entities: Vec<EntityId>§gizmo_mode: GizmoMode§gizmo_space: GizmoSpace§entities: HashMap<EntityId, ViewportEntity>§lights: Vec<LightData>§show_stats: bool§show_fps: bool§show_camera_info: bool§playback_time: f32§is_playing: boolImplementations§
Source§impl Viewport
impl Viewport
pub fn new(width: f32, height: f32) -> Self
pub fn resize(&mut self, width: f32, height: f32)
pub fn set_layout(&mut self, layout: ViewportLayout)
pub fn active_panel(&self) -> &ViewportPanel
pub fn active_panel_mut(&mut self) -> &mut ViewportPanel
pub fn spawn_entity(&mut self, name: String, kind: EntityKind) -> EntityId
pub fn spawn_at( &mut self, name: String, kind: EntityKind, pos: Vec3, ) -> EntityId
pub fn despawn(&mut self, id: EntityId)
pub fn select(&mut self, id: EntityId, additive: bool)
pub fn deselect_all(&mut self)
pub fn select_box(&mut self, min_screen: Vec2, max_screen: Vec2, additive: bool)
pub fn frame_selection(&mut self)
pub fn frame_all(&mut self)
pub fn set_snap_view(&mut self, view: SnapView)
pub fn toggle_gizmo_space(&mut self)
pub fn cycle_gizmo_mode(&mut self)
pub fn update(&mut self, dt: f32, input: &ViewportInput)
Sourcepub fn build_frame_data(&self) -> ViewportFrameData
pub fn build_frame_data(&self) -> ViewportFrameData
Build GPU frame data for the current frame
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Viewport
impl RefUnwindSafe for Viewport
impl Send for Viewport
impl Sync for Viewport
impl Unpin for Viewport
impl UnsafeUnpin for Viewport
impl UnwindSafe for Viewport
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.