mirror of
https://github.com/hannobraun/Fornjot
synced 2025-05-04 09:58:27 +00:00
Simplify
This commit is contained in:
parent
202641052b
commit
96204d4174
@ -1,14 +1,5 @@
|
||||
/// An input event
|
||||
pub enum InputEvent {
|
||||
/// Rotate the model around the focus point
|
||||
Rotation {
|
||||
/// The angle around the screen x axis to rotate (in radians)
|
||||
angle_x: f64,
|
||||
|
||||
/// The angle around the screen y axis to rotate (in radians)
|
||||
angle_y: f64,
|
||||
},
|
||||
|
||||
/// Move the view forwards and backwards
|
||||
Zoom(f64),
|
||||
}
|
||||
|
@ -73,9 +73,6 @@ impl Viewer {
|
||||
};
|
||||
|
||||
match event {
|
||||
InputEvent::Rotation { angle_x, angle_y } => {
|
||||
self.camera.apply_rotation(angle_x, angle_y, focus_point);
|
||||
}
|
||||
InputEvent::Zoom(zoom_delta) => {
|
||||
self.camera.apply_zoom(zoom_delta, focus_point);
|
||||
}
|
||||
@ -104,7 +101,15 @@ impl Viewer {
|
||||
let angle_y =
|
||||
diff_x * self.camera_tuning_config.rotation_sensitivity;
|
||||
|
||||
Some(InputEvent::Rotation { angle_x, angle_y })
|
||||
if let Some(focus_point) = self.focus_point {
|
||||
self.camera.apply_rotation(
|
||||
angle_x,
|
||||
angle_y,
|
||||
focus_point,
|
||||
);
|
||||
}
|
||||
|
||||
None
|
||||
}
|
||||
MouseButton::Right => {
|
||||
if let Some(focus_point) = self.focus_point {
|
||||
|
Loading…
Reference in New Issue
Block a user