Rework the trait exports.
`use vec::an_operation` will import a vector-applicable operation trait. `use mat::an_operation` will import a matrix-applicable operation trait.
This commit is contained in:
parent
eb4e4a6aeb
commit
1b31304a9e
19
src/mat.rs
19
src/mat.rs
|
@ -5,27 +5,22 @@ use std::num::{One, Zero};
|
|||
use std::cmp::ApproxEq;
|
||||
use std::vec::{VecIterator, VecMutIterator};
|
||||
use vec::{Vec1, Vec2, Vec3, Vec4, Vec5, Vec6};
|
||||
use traits::dim::Dim;
|
||||
use traits::inv::Inv;
|
||||
use traits::transpose::Transpose;
|
||||
use traits::rlmul::{RMul, LMul};
|
||||
use traits::transformation::Transform;
|
||||
use traits::homogeneous::{FromHomogeneous, ToHomogeneous};
|
||||
use traits::indexable::Indexable;
|
||||
use traits::column::Column;
|
||||
use traits::row::Row;
|
||||
use traits::iterable::{Iterable, IterableMut};
|
||||
use traits::outer::Outer;
|
||||
use traits::scalar_op::{ScalarAdd, ScalarSub};
|
||||
|
||||
pub use traits::dim::*;
|
||||
pub use traits::indexable::*;
|
||||
pub use traits::iterable::*;
|
||||
pub use traits::outer::*;
|
||||
pub use traits::scalar_op::*;
|
||||
pub use traits::mat_cast::*;
|
||||
pub use traits::column::*;
|
||||
pub use traits::row::*;
|
||||
pub use traits::inv::*;
|
||||
pub use traits::rlmul::*;
|
||||
pub use traits::rotation::*;
|
||||
pub use traits::transformation::*;
|
||||
pub use traits::translation::*;
|
||||
pub use traits::transpose::*;
|
||||
pub use traits::homogeneous::*;
|
||||
|
||||
mod mat_macros;
|
||||
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
use std::num::{Zero, One};
|
||||
use vec::Vec3;
|
||||
use mat::{Mat1, Mat2, Mat3};
|
||||
use traits::inv::Inv;
|
||||
use traits::row::Row;
|
||||
use mat::{Mat1, Mat2, Mat3, Inv, Row};
|
||||
|
||||
// some specializations:
|
||||
impl<N: Num + Clone>
|
||||
|
|
28
src/vec.rs
28
src/vec.rs
|
@ -4,17 +4,23 @@ use std::rand::Rng;
|
|||
use std::vec::{VecIterator, VecMutIterator};
|
||||
use std::iterator::{Iterator, FromIterator};
|
||||
use std::cmp::ApproxEq;
|
||||
use traits::basis::Basis;
|
||||
use traits::dim::Dim;
|
||||
use traits::translation::{Translation, Translate};
|
||||
use traits::transformation::Transform;
|
||||
use traits::rotation::Rotate;
|
||||
use traits::homogeneous::{FromHomogeneous, ToHomogeneous};
|
||||
use traits::indexable::Indexable;
|
||||
use traits::scalar_op::{ScalarAdd, ScalarSub};
|
||||
use traits::iterable::{Iterable, IterableMut};
|
||||
use traits::vec_cast::VecCast;
|
||||
use traits::vector::{Vec, AlgebraicVec};
|
||||
|
||||
pub use traits::translation::*;
|
||||
pub use traits::transformation::*;
|
||||
pub use traits::rotation::*;
|
||||
pub use traits::homogeneous::*;
|
||||
pub use traits::vec_cast::*;
|
||||
pub use traits::vector::*;
|
||||
pub use traits::basis::*;
|
||||
pub use traits::dim::*;
|
||||
pub use traits::basis::*;
|
||||
pub use traits::indexable::*;
|
||||
pub use traits::iterable::*;
|
||||
pub use traits::sample::*;
|
||||
pub use traits::scalar_op::*;
|
||||
pub use traits::cross::*;
|
||||
pub use traits::sample::*;
|
||||
pub use traits::row::*;
|
||||
|
||||
mod vec_macros;
|
||||
|
||||
|
|
|
@ -1,11 +1,5 @@
|
|||
use std::num::{Zero, One};
|
||||
use traits::basis::Basis;
|
||||
use traits::cross::{Cross, CrossMatrix};
|
||||
use traits::sample::UniformSphereSample;
|
||||
use traits::vec_cast::VecCast;
|
||||
use traits::vector::{AlgebraicVec};
|
||||
use traits::row::Row;
|
||||
use vec::{Vec1, Vec2, Vec3};
|
||||
use vec::{Vec1, Vec2, Vec3, Row, AlgebraicVec, VecCast, UniformSphereSample, Cross, CrossMatrix, Basis};
|
||||
use mat::Mat3;
|
||||
|
||||
impl<N: Mul<N, N> + Sub<N, N>> Cross<Vec1<N>> for Vec2<N> {
|
||||
|
|
Loading…
Reference in New Issue