Align and reformat.

This commit is contained in:
Dimitri Sabadie 2019-04-21 18:12:04 +02:00
parent 70d6cf2081
commit 305ce7ac93
2 changed files with 11 additions and 4 deletions

View File

@ -1,4 +1,6 @@
use cgmath::{BaseFloat, BaseNum, InnerSpace, Quaternion, VectorSpace, Vector1, Vector2, Vector3, Vector4};
use cgmath::{
BaseFloat, BaseNum, InnerSpace, Quaternion, VectorSpace, Vector1, Vector2, Vector3, Vector4
};
use crate::interpolate::{Additive, Interpolate, Linear, One, cubic_hermite_def};
@ -14,7 +16,8 @@ macro_rules! impl_interpolate_vec {
}
}
impl<T> Interpolate<T> for $($t)*<T> where Self: InnerSpace<Scalar = T>, T: Additive + BaseFloat + One {
impl<T> Interpolate<T> for $($t)*<T>
where Self: InnerSpace<Scalar = T>, T: Additive + BaseFloat + One {
fn lerp(a: Self, b: Self, t: T) -> Self {
a.lerp(b, t)
}
@ -41,7 +44,8 @@ impl<T> Linear<T> for Quaternion<T> where T: BaseFloat {
}
}
impl<T> Interpolate<T> for Quaternion<T> where Self: InnerSpace<Scalar = T>, T: Additive + BaseFloat + One {
impl<T> Interpolate<T> for Quaternion<T>
where Self: InnerSpace<Scalar = T>, T: Additive + BaseFloat + One {
fn lerp(a: Self, b: Self, t: T) -> Self {
a.nlerp(b, t)
}

View File

@ -1,5 +1,8 @@
use alga::general::{ClosedAdd, ClosedDiv, ClosedMul, ClosedSub};
use nalgebra::{DefaultAllocator, DimName, Point, Scalar, Vector, Vector1, Vector2, Vector3, Vector4, Vector5, Vector6};
use nalgebra::{
DefaultAllocator, DimName, Point, Scalar, Vector, Vector1, Vector2, Vector3, Vector4, Vector5,
Vector6
};
use nalgebra::allocator::Allocator;
use num_traits as nt;
use std::ops::Mul;