feat: stuff

This commit is contained in:
2024-03-24 16:45:17 +01:00
parent f1f038ccca
commit 61d3b15c73
10 changed files with 260 additions and 138 deletions

View File

@@ -1,21 +1,15 @@
use super::{triangle::Triangle, FloatValue};
use bvh::{aabb::Aabb, bvh::Bvh};
use nalgebra::{ClosedAdd, ClosedMul, ClosedSub, Scalar, SimdPartialOrd};
use num::{Float, FromPrimitive};
use super::triangle::Triangle;
#[derive(Debug)]
pub struct Mesh<T: SimdPartialOrd + Scalar + Copy> {
pub aabb: Aabb<T, 3>,
pub bvh: Bvh<T, 3>,
pub triangles: Vec<Triangle<T>>,
pub struct Mesh {
pub aabb: Aabb<FloatValue, 3>,
pub bvh: Bvh<FloatValue, 3>,
pub triangles: Vec<Triangle>,
}
impl<T> From<Vec<Triangle<T>>> for Mesh<T>
where
T: SimdPartialOrd + Scalar + Copy + ClosedMul + ClosedAdd + ClosedSub + Float + FromPrimitive,
{
fn from(mut triangles: Vec<Triangle<T>>) -> Self {
impl From<Vec<Triangle>> for Mesh {
fn from(mut triangles: Vec<Triangle>) -> Self {
Self {
aabb: triangles
.get(0)