mirror of
https://github.com/hannobraun/Fornjot
synced 2025-05-08 11:58:27 +00:00
Simplify
This commit is contained in:
parent
2b0c5bdbf7
commit
44ab4227da
@ -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();
|
||||
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user