2017-08-03 01:37:44 +08:00
|
|
|
use num::One;
|
2016-12-05 05:44:42 +08:00
|
|
|
|
2017-08-03 01:37:44 +08:00
|
|
|
use alga::general::Real;
|
2016-12-05 05:44:42 +08:00
|
|
|
|
2017-08-03 01:37:44 +08:00
|
|
|
use core::{DefaultAllocator, MatrixN};
|
2016-12-05 05:44:42 +08:00
|
|
|
use core::dimension::{DimNameAdd, DimNameSum, U1};
|
2017-08-03 01:37:44 +08:00
|
|
|
use core::allocator::Allocator;
|
2016-12-05 05:44:42 +08:00
|
|
|
|
2017-08-03 01:37:44 +08:00
|
|
|
use geometry::{Transform, TCategory};
|
2016-12-05 05:44:42 +08:00
|
|
|
|
|
|
|
|
2017-08-03 01:37:44 +08:00
|
|
|
impl<N: Real, D: DimNameAdd<U1>, C: TCategory> Transform<N, D, C>
|
|
|
|
where DefaultAllocator: Allocator<N, DimNameSum<D, U1>, DimNameSum<D, U1>> {
|
2016-12-05 05:44:42 +08:00
|
|
|
/// Creates a new identity transform.
|
|
|
|
#[inline]
|
|
|
|
pub fn identity() -> Self {
|
2017-08-03 01:37:44 +08:00
|
|
|
Self::from_matrix_unchecked(MatrixN::<_, DimNameSum<D, U1>>::identity())
|
2016-12-05 05:44:42 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-08-03 01:37:44 +08:00
|
|
|
impl<N: Real, D: DimNameAdd<U1>, C: TCategory> One for Transform<N, D, C>
|
|
|
|
where DefaultAllocator: Allocator<N, DimNameSum<D, U1>, DimNameSum<D, U1>> {
|
2016-12-05 05:44:42 +08:00
|
|
|
/// Creates a new identity transform.
|
|
|
|
#[inline]
|
|
|
|
fn one() -> Self {
|
|
|
|
Self::identity()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|