cgmath
cgmath copied to clipboard
Remove Transform::{one, concat} methods from Rotation and Transform
These should be inherited from One, with concat being the multiplication operator.
Edit: To clarify, both traits do not currently implement these operators.
This has the added benefit of allowing us to implement the rotation traits on matrices.
Looking at it now, this will require a trait impl of:
impl<P: EuclideanSpace, R: Rotation<P>> One for Decomposed<P::Diff, R>
This causes:
error: the type parameter `P` is not constrained by the impl trait, self type, or predicates [--explain E0207]
--> src/transform.rs:60:6
60 |> impl<P: EuclideanSpace, R: Rotation<P>> One for Decomposed<P::Diff, R> {
|> ^
We'll need to finally bite the bullet and convert Rotation and Transform to use associated types if we want to do this. So:
trait Rotation: Sized + One {
type Vector: InnerSpace;
type Point: EuclideanSpace<Diff = Vector>;
...
}
trait Transform: Sized + One {
type Vector: InnerSpace;
type Point: EuclideanSpace<Diff = Vector>;
...
}