Use f64 on the geometry side

This commit is contained in:
Hanno Braun 2024-11-05 18:02:31 +01:00
parent 9b4ae17a13
commit f04983e6ad
2 changed files with 8 additions and 3 deletions

View File

@ -24,7 +24,7 @@ impl Mesh {
#[derive(Clone, Copy)]
pub struct Vertex {
pub point: [f32; 3],
pub point: [f64; 3],
}
pub type Index = u32;

View File

@ -192,8 +192,13 @@ impl Renderer {
let mut vertices = Vec::new();
for triangle in mesh.triangles() {
let triangle = triangle
.map(|index| Vec3::from(mesh.vertices()[index as usize].point));
let triangle = triangle.map(|index| {
Vec3::from(
mesh.vertices()[index as usize]
.point
.map(|coord| coord as f32),
)
});
let normal = {
let [a, b, c] = triangle;