make use of into

This commit is contained in:
Quaternions 2024-02-21 09:15:05 -08:00
parent c0a85cd719
commit b73da3e552

View File

@ -35,14 +35,9 @@ where
integer::Planar64Mat3::try_from( integer::Planar64Mat3::try_from(
glam::Mat3A::from_diagonal(glam::Vec3::splat(placement.scale)) glam::Mat3A::from_diagonal(glam::Vec3::splat(placement.scale))
//TODO: figure this out //TODO: figure this out
*glam::Mat3A::from_quat(glam::Quat::from_xyzw( *glam::Mat3A::from_quat(glam::Quat::from_array(placement.rotation.into()))
placement.rotation.v.x,//b
placement.rotation.v.y,//c
placement.rotation.v.z,//d
placement.rotation.s,//a
))
).unwrap(), ).unwrap(),
valve_transform(<[f32;3]>::from(placement.origin)), valve_transform(placement.origin.into()),
), ),
color:glam::Vec4::ONE, color:glam::Vec4::ONE,
} }
@ -76,9 +71,9 @@ where
//normal //normal
let normal=face.normal(); let normal=face.normal();
let normal_idx=spam_normal.len() as u32; 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 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(); let pos_idx=spam_pos.len();
spam_pos.push(valve_transform(vertex_xyz)); spam_pos.push(valve_transform(vertex_xyz));
@ -130,7 +125,7 @@ where
attributes:TEMP_TOUCH_ME_ATTRIBUTE, attributes:TEMP_TOUCH_ME_ATTRIBUTE,
transform:integer::Planar64Affine3::new( transform:integer::Planar64Affine3::new(
integer::Planar64Mat3::default(), integer::Planar64Mat3::default(),
valve_transform(<[f32;3]>::from(world_model.origin)) valve_transform(world_model.origin.into())
), ),
color:glam::Vec4::ONE, color:glam::Vec4::ONE,
}, },
@ -256,8 +251,8 @@ where
let mut spam_tex=Vec::with_capacity(model.vertices().len()); let mut spam_tex=Vec::with_capacity(model.vertices().len());
let mut spam_vertices=Vec::with_capacity(model.vertices().len()); let mut spam_vertices=Vec::with_capacity(model.vertices().len());
for (i,vertex) in model.vertices().iter().enumerate(){ for (i,vertex) in model.vertices().iter().enumerate(){
spam_pos.push(valve_transform(<[f32;3]>::from(vertex.position))); spam_pos.push(valve_transform(vertex.position.into()));
spam_normal.push(valve_transform(<[f32;3]>::from(vertex.normal))); spam_normal.push(valve_transform(vertex.normal.into()));
spam_tex.push(glam::Vec2::from_array(vertex.texture_coordinates)); spam_tex.push(glam::Vec2::from_array(vertex.texture_coordinates));
spam_vertices.push(model::IndexedVertex{ spam_vertices.push(model::IndexedVertex{
pos:model::PositionId::new(i as u32), pos:model::PositionId::new(i as u32),