From b73da3e552dea9f88ed1a6a06a30bf08bab682fe Mon Sep 17 00:00:00 2001 From: Quaternions Date: Wed, 21 Feb 2024 09:15:05 -0800 Subject: [PATCH] make use of into --- src/bsp.rs | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/src/bsp.rs b/src/bsp.rs index 4987acf..93b63d5 100644 --- a/src/bsp.rs +++ b/src/bsp.rs @@ -35,14 +35,9 @@ where integer::Planar64Mat3::try_from( glam::Mat3A::from_diagonal(glam::Vec3::splat(placement.scale)) //TODO: figure this out - *glam::Mat3A::from_quat(glam::Quat::from_xyzw( - placement.rotation.v.x,//b - placement.rotation.v.y,//c - placement.rotation.v.z,//d - placement.rotation.s,//a - )) + *glam::Mat3A::from_quat(glam::Quat::from_array(placement.rotation.into())) ).unwrap(), - valve_transform(<[f32;3]>::from(placement.origin)), + valve_transform(placement.origin.into()), ), color:glam::Vec4::ONE, } @@ -76,9 +71,9 @@ where //normal let normal=face.normal(); let normal_idx=spam_normal.len() as u32; - spam_normal.push(valve_transform(<[f32;3]>::from(normal))); + spam_normal.push(valve_transform(normal.into())); let mut polygon_iter=face.vertex_positions().map(|vertex_position|{ - let vertex_xyz=<[f32;3]>::from(vertex_position); + let vertex_xyz=vertex_position.into(); let pos_idx=spam_pos.len(); spam_pos.push(valve_transform(vertex_xyz)); @@ -130,7 +125,7 @@ where attributes:TEMP_TOUCH_ME_ATTRIBUTE, transform:integer::Planar64Affine3::new( integer::Planar64Mat3::default(), - valve_transform(<[f32;3]>::from(world_model.origin)) + valve_transform(world_model.origin.into()) ), color:glam::Vec4::ONE, }, @@ -256,8 +251,8 @@ where let mut spam_tex=Vec::with_capacity(model.vertices().len()); let mut spam_vertices=Vec::with_capacity(model.vertices().len()); for (i,vertex) in model.vertices().iter().enumerate(){ - spam_pos.push(valve_transform(<[f32;3]>::from(vertex.position))); - spam_normal.push(valve_transform(<[f32;3]>::from(vertex.normal))); + spam_pos.push(valve_transform(vertex.position.into())); + spam_normal.push(valve_transform(vertex.normal.into())); spam_tex.push(glam::Vec2::from_array(vertex.texture_coordinates)); spam_vertices.push(model::IndexedVertex{ pos:model::PositionId::new(i as u32),