Simplify function parameter

This commit is contained in:
Hanno Braun 2025-03-19 20:51:05 +01:00
parent 2d23e9f65f
commit 2bb2899bcc
2 changed files with 8 additions and 5 deletions

View File

@ -1,7 +1,7 @@
//! Viewer camera module
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 crate::screen::NormalizedScreenPosition;
@ -82,10 +82,10 @@ impl Camera {
pub fn focus_point(
&self,
cursor: Option<NormalizedScreenPosition>,
model: &Model,
mesh: &Mesh,
aabb: &Aabb<3>,
) -> FocusPoint {
self.calculate_focus_point(cursor, &model.mesh)
self.calculate_focus_point(cursor, mesh)
.unwrap_or_else(|| FocusPoint(aabb.center()))
}

View File

@ -144,8 +144,11 @@ impl Viewer {
pub fn add_focus_point(&mut self) {
if let Some((model, aabb)) = &self.model {
if self.focus_point.is_none() {
self.focus_point =
Some(self.camera.focus_point(self.cursor, model, aabb));
self.focus_point = Some(self.camera.focus_point(
self.cursor,
&model.mesh,
aabb,
));
}
}
}