mirror of
https://github.com/hannobraun/Fornjot
synced 2025-03-01 18:45:59 +00:00
Rename ProcessedShape
to Model
This commit is contained in:
parent
6d735f9c11
commit
d6d657d401
@ -6,7 +6,7 @@ use crate::mesh::Mesh;
|
||||
|
||||
/// A processed shape
|
||||
#[derive(Clone, Debug)]
|
||||
pub struct ProcessedShape {
|
||||
pub struct Model {
|
||||
/// The axis-aligned bounding box of the shape
|
||||
pub aabb: Aabb<3>,
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
//! Viewer camera module
|
||||
use std::f64::consts::FRAC_PI_2;
|
||||
|
||||
use fj_interop::{mesh::Mesh, processed_shape::ProcessedShape};
|
||||
use fj_interop::{mesh::Mesh, processed_shape::Model};
|
||||
use fj_math::{Aabb, Point, Scalar, Transform, Vector};
|
||||
|
||||
use crate::screen::NormalizedScreenPosition;
|
||||
@ -82,7 +82,7 @@ impl Camera {
|
||||
pub fn focus_point(
|
||||
&self,
|
||||
cursor: Option<NormalizedScreenPosition>,
|
||||
shape: &ProcessedShape,
|
||||
shape: &Model,
|
||||
) -> FocusPoint {
|
||||
self.calculate_focus_point(cursor, &shape.mesh)
|
||||
.unwrap_or_else(|| FocusPoint(shape.aabb.center()))
|
||||
|
@ -1,4 +1,4 @@
|
||||
use fj_interop::processed_shape::ProcessedShape;
|
||||
use fj_interop::processed_shape::Model;
|
||||
use fj_math::Aabb;
|
||||
use tracing::warn;
|
||||
|
||||
@ -28,7 +28,7 @@ pub struct Viewer {
|
||||
pub renderer: Renderer,
|
||||
|
||||
/// The shape
|
||||
pub shape: Option<ProcessedShape>,
|
||||
pub shape: Option<Model>,
|
||||
}
|
||||
|
||||
impl Viewer {
|
||||
@ -60,7 +60,7 @@ impl Viewer {
|
||||
}
|
||||
|
||||
/// Handle the shape being updated
|
||||
pub fn handle_shape_update(&mut self, shape: ProcessedShape) {
|
||||
pub fn handle_shape_update(&mut self, shape: Model) {
|
||||
self.renderer.update_geometry((&shape.mesh).into());
|
||||
|
||||
let aabb = shape.aabb;
|
||||
|
@ -1,4 +1,4 @@
|
||||
use fj_interop::{mesh::Mesh, processed_shape::ProcessedShape};
|
||||
use fj_interop::{mesh::Mesh, processed_shape::Model};
|
||||
use fj_math::{Aabb, Point};
|
||||
use fj_viewer::{
|
||||
InputEvent, NormalizedScreenPosition, RendererInitError, Screen,
|
||||
@ -22,7 +22,7 @@ pub fn display(mesh: Mesh<Point<3>>, invert_zoom: bool) -> Result<(), Error> {
|
||||
let window = Window::new(&event_loop)?;
|
||||
let mut viewer = block_on(Viewer::new(&window))?;
|
||||
|
||||
viewer.handle_shape_update(ProcessedShape {
|
||||
viewer.handle_shape_update(Model {
|
||||
aabb: Aabb::<3>::from_points(mesh.vertices()),
|
||||
mesh,
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user