mirror of
https://github.com/hannobraun/Fornjot
synced 2025-05-07 03:18:30 +00:00
Simplify function parameter
This commit is contained in:
parent
2d23e9f65f
commit
2bb2899bcc
@ -1,7 +1,7 @@
|
|||||||
//! Viewer camera module
|
//! Viewer camera module
|
||||||
use std::f64::consts::FRAC_PI_2;
|
use std::f64::consts::FRAC_PI_2;
|
||||||
|
|
||||||
use fj_interop::{Mesh, Model};
|
use fj_interop::Mesh;
|
||||||
use fj_math::{Aabb, Point, Scalar, Transform, Vector};
|
use fj_math::{Aabb, Point, Scalar, Transform, Vector};
|
||||||
|
|
||||||
use crate::screen::NormalizedScreenPosition;
|
use crate::screen::NormalizedScreenPosition;
|
||||||
@ -82,10 +82,10 @@ impl Camera {
|
|||||||
pub fn focus_point(
|
pub fn focus_point(
|
||||||
&self,
|
&self,
|
||||||
cursor: Option<NormalizedScreenPosition>,
|
cursor: Option<NormalizedScreenPosition>,
|
||||||
model: &Model,
|
mesh: &Mesh,
|
||||||
aabb: &Aabb<3>,
|
aabb: &Aabb<3>,
|
||||||
) -> FocusPoint {
|
) -> FocusPoint {
|
||||||
self.calculate_focus_point(cursor, &model.mesh)
|
self.calculate_focus_point(cursor, mesh)
|
||||||
.unwrap_or_else(|| FocusPoint(aabb.center()))
|
.unwrap_or_else(|| FocusPoint(aabb.center()))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -144,8 +144,11 @@ impl Viewer {
|
|||||||
pub fn add_focus_point(&mut self) {
|
pub fn add_focus_point(&mut self) {
|
||||||
if let Some((model, aabb)) = &self.model {
|
if let Some((model, aabb)) = &self.model {
|
||||||
if self.focus_point.is_none() {
|
if self.focus_point.is_none() {
|
||||||
self.focus_point =
|
self.focus_point = Some(self.camera.focus_point(
|
||||||
Some(self.camera.focus_point(self.cursor, model, aabb));
|
self.cursor,
|
||||||
|
&model.mesh,
|
||||||
|
aabb,
|
||||||
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user