MCPcopy Create free account
hub / github.com/TanTanDev/first_voxel_engine / process_scroll

Method process_scroll

src/camera_controller.rs:83–89  ·  view source on GitHub ↗
(&mut self, delta: &MouseScrollDelta)

Source from the content-addressed store, hash-verified

81 }
82
83 pub fn process_scroll(&mut self, delta: &MouseScrollDelta) {
84 self.scroll = -match delta {
85 // I'm assuming a line is about 100 pixels
86 MouseScrollDelta::LineDelta(_, scroll) => scroll * 100.0,
87 MouseScrollDelta::PixelDelta(PhysicalPosition { y: scroll, .. }) => *scroll as f32,
88 };
89 }
90
91 pub fn update_camera(&mut self, camera: &mut Camera, dt: Duration) {
92 let dt = dt.as_secs_f32();

Callers 1

inputMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected