use super::super::vector::{VectorDifference, VectorAdd};
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct Translation<T> {
pub delta : T,
}
impl<T> From<T> for Translation<T> where T: VectorDifference<T> {
fn from(t: T) -> Self {
Translation { delta: t }
}
}
impl Translation<(i8, i8, i8)> {
pub fn new(x: i8, y: i8, z: i8) -> Translation<(i8, i8, i8)> {
Translation { delta: (x, y, z) }
}
}
pub trait Translatable<T> where T: VectorAdd<T> {
fn translate(&mut self, translation: &Translation<T>);
}