cargo fmt

This commit is contained in:
Christof Petig 2023-04-04 23:47:31 +02:00
parent 8d2b9b9a9c
commit f4a87e9f0b
2 changed files with 37 additions and 31 deletions

View File

@ -20,24 +20,28 @@ pub fn main() {
let manifest = ItemImagesSpec::load_expect("voxygen.item_image_manifest");
for (_, spec) in manifest.read().0.iter() {
match spec {
ImageSpec::Vox(specifier, model_index) => voxel_to_png(&specifier, Transform::default(), args.scale, model_index),
ImageSpec::VoxTrans(specifier, offset, [rot_x, rot_y, rot_z], zoom, model_index) => voxel_to_png(
&specifier,
Transform {
ori: Quaternion::rotation_x(rot_x * std::f32::consts::PI / 180.0)
.rotated_y(rot_y * std::f32::consts::PI / 180.0)
.rotated_z(rot_z * std::f32::consts::PI / 180.0),
offset: Vec3::from(*offset),
/* FIXME: This is a dirty workaround to not cut off the edges of some objects
* like ./img-export/weapon/component/axe/poleaxe/bronze.vox
* more details here: https://gitlab.com/veloren/veloren/-/merge_requests/3494#note_1205030803 */
zoom: *zoom * 0.8,
orth: true,
stretch: false,
},
args.scale,
model_index,
),
ImageSpec::Vox(specifier, model_index) => {
voxel_to_png(&specifier, Transform::default(), args.scale, model_index)
},
ImageSpec::VoxTrans(specifier, offset, [rot_x, rot_y, rot_z], zoom, model_index) => {
voxel_to_png(
&specifier,
Transform {
ori: Quaternion::rotation_x(rot_x * std::f32::consts::PI / 180.0)
.rotated_y(rot_y * std::f32::consts::PI / 180.0)
.rotated_z(rot_z * std::f32::consts::PI / 180.0),
offset: Vec3::from(*offset),
/* FIXME: This is a dirty workaround to not cut off the edges of some
* objects like ./img-export/weapon/component/
* axe/poleaxe/bronze.vox more details here: https://gitlab.com/veloren/veloren/-/merge_requests/3494#note_1205030803 */
zoom: *zoom * 0.8,
orth: true,
stretch: false,
},
args.scale,
model_index,
)
},
ImageSpec::Png(specifier) => {
println!("Skip png image {}", specifier);
continue;

View File

@ -36,19 +36,21 @@ impl ImageSpec {
},
SampleStrat::None,
),
ImageSpec::VoxTrans(specifier, offset, [rot_x, rot_y, rot_z], zoom, model_index) => Graphic::Voxel(
graceful_load_segment_no_skin(specifier, *model_index),
Transform {
ori: Quaternion::rotation_x(rot_x * std::f32::consts::PI / 180.0)
.rotated_y(rot_y * std::f32::consts::PI / 180.0)
.rotated_z(rot_z * std::f32::consts::PI / 180.0),
offset: Vec3::from(*offset),
zoom: *zoom,
orth: true, // TODO: Is this what we want here? @Pfau
stretch: false,
},
SampleStrat::None,
),
ImageSpec::VoxTrans(specifier, offset, [rot_x, rot_y, rot_z], zoom, model_index) => {
Graphic::Voxel(
graceful_load_segment_no_skin(specifier, *model_index),
Transform {
ori: Quaternion::rotation_x(rot_x * std::f32::consts::PI / 180.0)
.rotated_y(rot_y * std::f32::consts::PI / 180.0)
.rotated_z(rot_z * std::f32::consts::PI / 180.0),
offset: Vec3::from(*offset),
zoom: *zoom,
orth: true, // TODO: Is this what we want here? @Pfau
stretch: false,
},
SampleStrat::None,
)
},
}
}
}