Add units to the different Vec3 "types" (Meters and Index, so far)

This commit is contained in:
2020-09-26 17:05:15 -07:00
parent 00f22c95d0
commit 55d6171325
9 changed files with 180 additions and 107 deletions

View File

@@ -1,5 +1,5 @@
use ansi_term::Color::RGB;
use crate::geom::{Vec2, Vec3};
use crate::geom::{Meters, Vec2, Vec3};
use crate::{flt::{Flt, Real}, Material as _};
use crate::mat;
use crate::sim::{Cell, GenericSim};
@@ -92,7 +92,7 @@ impl<'a> RenderSteps<'a> {
let y_prop = y_px as Flt / self.im.height() as Flt;
let y_m = y_prop * (self.sim.height() as Flt * self.sim.feature_size());
let z_m = self.z as Flt * self.sim.feature_size();
self.sim.sample(Vec3::new(x_m, y_m, z_m))
self.sim.sample(Meters(Vec3::new(x_m, y_m, z_m)))
}
////////////// Ex/Ey/Bz configuration ////////////