use num::cast::*; use vec::Vec3; pub enum Angle { degrees(T), radians(T), } pub impl Angle { pure fn degrees() -> T { match self { degrees(theta) => theta, radians(theta) => theta * cast(180f64 / f64::consts::pi) } } pure fn radians() -> T { match self { degrees(theta) => theta * cast(f64::consts::pi / 180f64), radians(theta) => theta } } } pub struct AxisRotation { axis: Vec3, theta: Angle, } pub struct Euler { x: T, // pitch y: T, // yaw z: T, // roll }