From 226913d5f5090e2bd08864bd8f5f83bddc38ac6d Mon Sep 17 00:00:00 2001 From: Aidar Shaikhiev Date: Mon, 3 Jun 2024 03:09:06 +0500 Subject: [PATCH] Fix old compilation bug --- voxygen/src/bin/img-export.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/voxygen/src/bin/img-export.rs b/voxygen/src/bin/img-export.rs index 30145d8518..7ef3361641 100644 --- a/voxygen/src/bin/img-export.rs +++ b/voxygen/src/bin/img-export.rs @@ -70,8 +70,8 @@ fn voxel_to_png(specifier: &String, transform: Transform, scale: u32, model_inde // model_size let rotated_size = calc_rotated_size(&ori_mat, &aabb_size); let projection_size = Vec2 { - x: ((rotated_size.y as u32) * scale) as u16, - y: ((rotated_size.z as u32) * scale) as u16, + x: ((rotated_size.x as u32) * scale) as u16, + y: ((rotated_size.y as u32) * scale) as u16, }; let segment = Segment::from_vox(dot_vox_data, false, model_index); let path = format!("img-export/{}.png", &specifier_to_path(specifier)); @@ -94,9 +94,9 @@ fn calc_rotated_size(ori_mat: &Mat4, aabb_size: &Vec3) -> Vec3 { z: 0f32, }; let aabb_max = Vec3 { - x: aabb_size.y as f32, - y: aabb_size.z as f32, - z: aabb_size.x as f32, + x: aabb_size.x as f32, + y: aabb_size.y as f32, + z: aabb_size.z as f32, }; let aabb_vertices: [Vec3; 8] = [ Vec3::new(aabb_min.x, aabb_min.y, aabb_min.z), @@ -108,7 +108,7 @@ fn calc_rotated_size(ori_mat: &Mat4, aabb_size: &Vec3) -> Vec3 { Vec3::new(aabb_max.x, aabb_max.y, aabb_max.z), Vec3::new(aabb_min.x, aabb_max.y, aabb_max.z), ]; - let rotated_vertices = aabb_vertices.map(|c| (Vec4::::from(c) * *ori_mat).xyz()); + let rotated_vertices = aabb_vertices.map(|c| (*ori_mat * Vec4::::from(c)).xyz()); let max_xyz = rotated_vertices .iter() .copied()