more how
This commit is contained in:
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){
|
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();
|
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 let Some(plane_list)=maybe_plane_list{
|
||||||
|
if plane_list.len()<4{
|
||||||
|
println!("sussy planes!");
|
||||||
|
continue;
|
||||||
|
}
|
||||||
let mut polygon_list=Vec::new();
|
let mut polygon_list=Vec::new();
|
||||||
let mut mb=model::MeshBuilder::new();
|
let mut mb=model::MeshBuilder::new();
|
||||||
let color=mb.acquire_color_id(glam::Vec4::ONE);
|
let color=mb.acquire_color_id(glam::Vec4::ONE);
|
||||||
let tex=mb.acquire_tex_id(glam::Vec2::ZERO);
|
let tex=mb.acquire_tex_id(glam::Vec2::ZERO);
|
||||||
|
|
||||||
// for each face, determine one edge at a time until you complete the face
|
// 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 polygon_groups=model::PolygonGroup::PolygonList(model::PolygonList::new(polygon_list));
|
||||||
let physics_groups=vec![model::IndexedPhysicsGroup{
|
let physics_groups=vec![model::IndexedPhysicsGroup{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user