diff --git a/benches/construction.rs b/benches/construction.rs index 8afef416..cc4179d0 100644 --- a/benches/construction.rs +++ b/benches/construction.rs @@ -11,9 +11,9 @@ use na::{UnitQuaternion, Rotation2, Rotation3, Vector1, Vector3}; #[path="common/macros.rs"] mod macros; -bench_construction!(_bench_quaternion_from_axisangle, UnitQuaternion::new, axisangle: Vector3); +bench_construction!(_bench_quaternion_from_axisangle, UnitQuaternion::from_scaled_axis, axisangle: Vector3); bench_construction!(_bench_rot2_from_axisangle, Rotation2::new, axisangle: Vector1); bench_construction!(_bench_rot3_from_axisangle, Rotation3::new, axisangle: Vector3); -bench_construction!(_bench_quaternion_from_euler_angles, UnitQuaternion::new_with_euler_angles, roll: f32, pitch: f32, yaw: f32); -bench_construction!(_bench_rot3_from_euler_angles, Rotation3::new_with_euler_angles, roll: f32, pitch: f32, yaw: f32); +bench_construction!(_bench_quaternion_from_euler_angles, UnitQuaternion::from_euler_angles, roll: f32, pitch: f32, yaw: f32); +bench_construction!(_bench_rot3_from_euler_angles, Rotation3::from_euler_angles, roll: f32, pitch: f32, yaw: f32); diff --git a/src/structs/vectorn_macros.rs b/src/structs/vectorn_macros.rs index f6f81188..74749375 100644 --- a/src/structs/vectorn_macros.rs +++ b/src/structs/vectorn_macros.rs @@ -253,6 +253,15 @@ macro_rules! vecn_dvec_common_impl( } } + impl<'a, N: Copy + Div + Zero $(, $param : ArrayLength)*> Div<$vecn> for &'a $vecn { + type Output = $vecn; + + #[inline] + fn div(self, right: $vecn) -> $vecn { + self.clone() / right + } + } + impl<'a, N: Copy + Div + Zero $(, $param : ArrayLength)*> Div for &'a $vecn { type Output = $vecn;