Use made_valid instead of min/max

This commit is contained in:
Louis Pearson 2021-03-27 08:16:26 -06:00
parent 165065725e
commit ad0396d9f4

View File

@ -1325,14 +1325,13 @@ fn handle_build_area_add(
);
return;
}
let bb_id = ecs
.write_resource::<BuildAreas>()
.deref_mut()
.areas
.insert(Aabb {
min: Vec3::new(xlo.min(xhi), ylo.min(yhi), zlo.min(zhi)),
max: Vec3::new(xhi.max(xlo), yhi.max(ylo), zhi.max(zlo)),
});
let bb_id = ecs.write_resource::<BuildAreas>().deref_mut().areas.insert(
Aabb {
min: Vec3::new(xlo, ylo, zlo),
max: Vec3::new(xhi, yhi, zhi),
}
.made_valid(),
);
ecs.write_resource::<BuildAreas>()
.deref_mut()
.area_names