From f0d36c7d7b7b057a24654647f68f61ab64d92c87 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Fri, 27 Mar 2020 11:13:48 +0100 Subject: [PATCH] library: render: mesh: use nalgebra::zero instead --- pathtracer/src/render/mesh.rs | 4 ++-- pathtracer/src/serialize/vector.rs | 5 ----- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/pathtracer/src/render/mesh.rs b/pathtracer/src/render/mesh.rs index 9f9295d..6c41ae3 100644 --- a/pathtracer/src/render/mesh.rs +++ b/pathtracer/src/render/mesh.rs @@ -27,9 +27,9 @@ pub struct Mesh { #[derive(Debug, PartialEq, Deserialize)] pub(crate) struct Wavefront { pub obj_file: PathBuf, - #[serde(default = "crate::serialize::vector::zeros")] + #[serde(default = "nalgebra::zero")] translation: Vector, - #[serde(default = "crate::serialize::vector::zeros")] + #[serde(default = "nalgebra::zero")] rotation: Vector, #[serde(default = "crate::serialize::coefficient::default_identity")] scale: f32, diff --git a/pathtracer/src/serialize/vector.rs b/pathtracer/src/serialize/vector.rs index 8d02fea..7ffc605 100644 --- a/pathtracer/src/serialize/vector.rs +++ b/pathtracer/src/serialize/vector.rs @@ -14,8 +14,3 @@ where let v: Vector = Deserialize::deserialize(deserializer)?; Ok(Unit::new_normalize(v)) } - -/// Return a vector containing all zeros. -pub fn zeros() -> Vector { - Vector::new(0., 0., 0.) -}