pub struct ViewportPanel {
pub index: usize,
pub rect: ViewportRect,
pub camera: EditorCamera,
pub snap_view: SnapView,
pub render_settings: RenderSettings,
pub is_active: bool,
pub is_playing: bool,
pub show_gizmos: bool,
pub hover: HoverState,
pub frame_count: u64,
pub render_time_ms: f32,
pub hovered_port: Option<String>,
}Fields§
§index: usize§rect: ViewportRect§camera: EditorCamera§snap_view: SnapView§render_settings: RenderSettings§is_active: bool§is_playing: bool§show_gizmos: bool§hover: HoverState§frame_count: u64§render_time_ms: f32§hovered_port: Option<String>Implementations§
Source§impl ViewportPanel
impl ViewportPanel
pub fn new(index: usize, rect: ViewportRect) -> Self
pub fn resize(&mut self, rect: ViewportRect)
pub fn view_matrix(&self) -> Mat4
pub fn proj_matrix(&self) -> Mat4
pub fn view_proj(&self) -> Mat4
pub fn world_to_screen(&self, world: Vec3) -> Vec2
pub fn screen_to_ray(&self, screen_x: f32, screen_y: f32) -> (Vec3, Vec3)
Sourcepub fn update_hover(&mut self, screen_x: f32, screen_y: f32)
pub fn update_hover(&mut self, screen_x: f32, screen_y: f32)
Update hover position given raw cursor input
pub fn cycle_shading_mode(&mut self)
pub fn toggle_wireframe(&mut self)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ViewportPanel
impl RefUnwindSafe for ViewportPanel
impl Send for ViewportPanel
impl Sync for ViewportPanel
impl Unpin for ViewportPanel
impl UnsafeUnpin for ViewportPanel
impl UnwindSafe for ViewportPanel
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.