mirror of
https://github.com/hannobraun/Fornjot
synced 2025-05-11 21:38:31 +00:00
Simplify
This commit is contained in:
parent
2b0c5bdbf7
commit
44ab4227da
@ -1,7 +1,7 @@
|
|||||||
use glam::Vec3;
|
use glam::Vec3;
|
||||||
use wgpu::util::DeviceExt;
|
use wgpu::util::DeviceExt;
|
||||||
|
|
||||||
use crate::object::Object;
|
use crate::geometry::TriMesh;
|
||||||
|
|
||||||
use super::vertex::Vertex;
|
use super::vertex::Vertex;
|
||||||
|
|
||||||
@ -12,9 +12,7 @@ pub struct Geometry {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl Geometry {
|
impl Geometry {
|
||||||
pub fn new(device: &wgpu::Device, operation: &dyn Object) -> Self {
|
pub fn new(device: &wgpu::Device, tri_mesh: &TriMesh) -> Self {
|
||||||
let tri_mesh = operation.tri_mesh();
|
|
||||||
|
|
||||||
let mut indices = Vec::new();
|
let mut indices = Vec::new();
|
||||||
let mut vertices = Vec::new();
|
let mut vertices = Vec::new();
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@ use std::sync::Arc;
|
|||||||
use anyhow::anyhow;
|
use anyhow::anyhow;
|
||||||
use winit::window::Window;
|
use winit::window::Window;
|
||||||
|
|
||||||
use crate::view::OperationView;
|
use crate::{object::Object, view::OperationView};
|
||||||
|
|
||||||
use super::{geometry::Geometry, pipeline::Pipeline};
|
use super::{geometry::Geometry, pipeline::Pipeline};
|
||||||
|
|
||||||
@ -79,7 +79,8 @@ impl Renderer {
|
|||||||
pub fn render(&mut self, operations: &OperationView) -> anyhow::Result<()> {
|
pub fn render(&mut self, operations: &OperationView) -> anyhow::Result<()> {
|
||||||
let selected_operation = operations.selected();
|
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
|
let mut encoder = self
|
||||||
.device
|
.device
|
||||||
|
Loading…
Reference in New Issue
Block a user