From 8c574812ff0f3ab9fdaf16f7af2bf563c74b5ca4 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Tue, 9 Jan 2024 16:49:29 -0800 Subject: [PATCH] fix props --- src/load_bsp.rs | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) 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(),