This commit is contained in:
Hanno Braun 2025-03-18 20:53:06 +01:00
parent 2b0c5bdbf7
commit 44ab4227da
2 changed files with 5 additions and 6 deletions

View File

@ -1,7 +1,7 @@
use glam::Vec3;
use wgpu::util::DeviceExt;
use crate::object::Object;
use crate::geometry::TriMesh;
use super::vertex::Vertex;
@ -12,9 +12,7 @@ pub struct Geometry {
}
impl Geometry {
pub fn new(device: &wgpu::Device, operation: &dyn Object) -> Self {
let tri_mesh = operation.tri_mesh();
pub fn new(device: &wgpu::Device, tri_mesh: &TriMesh) -> Self {
let mut indices = Vec::new();
let mut vertices = Vec::new();

View File

@ -3,7 +3,7 @@ use std::sync::Arc;
use anyhow::anyhow;
use winit::window::Window;
use crate::view::OperationView;
use crate::{object::Object, view::OperationView};
use super::{geometry::Geometry, pipeline::Pipeline};
@ -79,7 +79,8 @@ impl Renderer {
pub fn render(&mut self, operations: &OperationView) -> anyhow::Result<()> {
let selected_operation = operations.selected();
let geometry = Geometry::new(&self.device, selected_operation);
let geometry =
Geometry::new(&self.device, &selected_operation.tri_mesh());
let mut encoder = self
.device