library: render: mesh: use nalgebra::zero instead

This commit is contained in:
Antoine Martin 2020-03-27 11:13:48 +01:00 committed by Bruno BELANYI
parent 15381d4bbd
commit f0d36c7d7b
2 changed files with 2 additions and 7 deletions

View file

@ -27,9 +27,9 @@ pub struct Mesh {
#[derive(Debug, PartialEq, Deserialize)] #[derive(Debug, PartialEq, Deserialize)]
pub(crate) struct Wavefront { pub(crate) struct Wavefront {
pub obj_file: PathBuf, pub obj_file: PathBuf,
#[serde(default = "crate::serialize::vector::zeros")] #[serde(default = "nalgebra::zero")]
translation: Vector, translation: Vector,
#[serde(default = "crate::serialize::vector::zeros")] #[serde(default = "nalgebra::zero")]
rotation: Vector, rotation: Vector,
#[serde(default = "crate::serialize::coefficient::default_identity")] #[serde(default = "crate::serialize::coefficient::default_identity")]
scale: f32, scale: f32,

View file

@ -14,8 +14,3 @@ where
let v: Vector = Deserialize::deserialize(deserializer)?; let v: Vector = Deserialize::deserialize(deserializer)?;
Ok(Unit::new_normalize(v)) Ok(Unit::new_normalize(v))
} }
/// Return a vector containing all zeros.
pub fn zeros() -> Vector {
Vector::new(0., 0., 0.)
}