pub struct InputState {
pub left_mouse_down: bool,
pub right_mouse_down: bool,
pub middle_mouse_down: bool,
pub last_cursor_x: f64,
pub last_cursor_y: f64,
pub cursor_x: f64,
pub cursor_y: f64,
pub scroll_delta: f32,
pub egui_wants_pointer: bool,
pub viewport_rect: ViewportRect,
}Expand description
Tracks raw input state for orbit camera control
Fields§
§left_mouse_down: bool§right_mouse_down: bool§middle_mouse_down: bool§last_cursor_x: f64§last_cursor_y: f64§cursor_x: f64§cursor_y: f64§scroll_delta: f32§egui_wants_pointer: bool§viewport_rect: ViewportRectThe central 3D viewport rect in screen pixels; only mouse events inside this area affect the camera
Implementations§
Source§impl InputState
impl InputState
Sourcepub fn apply_to_camera(
&mut self,
camera: &mut OrbitCamera,
_window_size: [u32; 2],
)
pub fn apply_to_camera( &mut self, camera: &mut OrbitCamera, _window_size: [u32; 2], )
Apply accumulated input to camera, then reset deltas. Only applies camera operations when the cursor is inside the 3D viewport area and egui does not want the pointer.
Trait Implementations§
Source§impl Clone for InputState
impl Clone for InputState
Source§fn clone(&self) -> InputState
fn clone(&self) -> InputState
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for InputState
impl Debug for InputState
Auto Trait Implementations§
impl Freeze for InputState
impl RefUnwindSafe for InputState
impl Send for InputState
impl Sync for InputState
impl Unpin for InputState
impl UnsafeUnpin for InputState
impl UnwindSafe for InputState
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