diff --git a/src/load_bsp.rs b/src/load_bsp.rs index 5119940..2ee9b6b 100644 --- a/src/load_bsp.rs +++ b/src/load_bsp.rs @@ -159,12 +159,16 @@ pub fn generate_indexed_models(input:&mut R)->Res }; crate::model::IndexedGroup{ - polys:mesh.vertex_strip_indices().map(|poly|{ - crate::model::IndexedPolygon{ - vertices:poly.map(|i|i as u32).collect() - } - }).collect(), texture, + polys:{ + //looking at the code, it would seem that the strips are pre-deindexed into triangle lists when calling this function + mesh.vertex_strip_indices().map(|strip|{ + strip.collect::>().chunks(3).map(|tri|{ + //tris are ccw, probably because of the quaternion + crate::model::IndexedPolygon{vertices:vec![tri[1] as u32,tri[0] as u32,tri[2] as u32]} + }).collect::>() + }).flatten().collect() + }, } }).collect(), instances:Vec::new(),