This commit is contained in:
Quaternions 2025-02-04 16:04:55 -08:00
parent d6d1c5365b
commit 80f28e8bf7

@ -126,12 +126,27 @@ pub fn convert<'a>(
if let Some(sides)=bsp.brush_sides.get(brush_start_idx..brush_start_idx+brush.num_brush_sides as usize){
let maybe_plane_list:Option<Vec<_>>=sides.iter().map(|side|bsp.plane(side.plane as usize)).collect();
if let Some(plane_list)=maybe_plane_list{
if plane_list.len()<4{
println!("sussy planes!");
continue;
}
let mut polygon_list=Vec::new();
let mut mb=model::MeshBuilder::new();
let color=mb.acquire_color_id(glam::Vec4::ONE);
let tex=mb.acquire_tex_id(glam::Vec2::ZERO);
// for each face, determine one edge at a time until you complete the face
for (face_id,face) in plane_list.iter().enumerate(){
// 1. find first edge
// 2. follow edges around face
// === finding first edge ===
// 1. pick any two additional planes to make a set of three
// 2. check if any planes occlude the intersection
// 3. use this test to replace left and right alternating until they are not occluded
let mut plane1=&plane_list[(face_id+1).rem_euclid(plane_list.len())];
let mut plane2=&plane_list[(face_id+2).rem_euclid(plane_list.len())];
}
let polygon_groups=model::PolygonGroup::PolygonList(model::PolygonList::new(polygon_list));
let physics_groups=vec![model::IndexedPhysicsGroup{