kennytm
f524d40403
Workaround rust-lang/rust#41478 .
...
Replace all `impl .. for Struct<<A as Angle>::Unitless>` by
`Struct<A::Unitless>`. This allows -Zsave-analysis to work on nightly, and
I think this is more readable too.
2017-05-02 01:15:46 +08:00
Brendan Zabarauskas
77260934a1
Clean up Sum and Product impls
...
This is for consistency with other impls
2017-04-26 21:56:02 +10:00
Ben Boeckel
240559b941
iter traits: impl iter::{Sum, Product}
...
This adds `Sum` trait for the `MatrixN`, `VectorN`, `Quaternion`
structures and the `Product` trait for `MatrixN`, `BasisN` and
`Quaternion`.
It also add constraints on the `Rotation` and `SquareMatrix` to require
the `Product` trait and `VectorSpace` to require `Sum`.
2017-04-25 11:01:18 -04:00
Brendan Zabarauskas
78555ec780
Drop rustc-serialize support
...
According to [Rust release milestone predictions](https://internals.rust-lang.org/t/rust-release-milestone-predictions/4591?u=dtolnay ), rustc-serialize is scheduled to be deprecated in next month's beta release of Rust.
Closes #395
2017-04-16 16:35:24 +10:00
Luxko
09c8727c7c
Add newline at end of file
2017-03-12 15:59:06 +08:00
Luxko
68d1d27222
Add SIMD support for determinant and inverse
...
Also:
- Change the travis script: no use `cargo bench`ing in beta or stable.
- Add bench test for Matrix4's determinant().
- clean code a bit
2017-02-25 20:31:38 +08:00
Luxko
d45536f1bd
Clean up a bit
2017-02-25 07:42:15 +08:00
Luxko
64924b954d
[WIP]Add basic SIMD support
...
- Add an opt-in SIMD support for the module. The feature requires crate
`simd` and specialization, thus can only be enabled under nightly. Under
the given benchmark certain operations were able to be up to 60% faster.
Currently the supported types as well as operations are highly limited.
- Clean up some deadly tests. Also add new tests for SIMD.
2017-02-25 07:26:11 +08:00
Marckvdv
d2d35b808b
Added component wise casting number for the matrix and point types.
2016-10-03 12:51:41 +02:00
Mark Hintz
f475822d9b
Removes #[repr(packed)] from all structs where it was specified.
...
This is intended as a partial fix for #375 . It doesn't also remove #[repr(C)],
since it's a bit unclear whether that's necessary.
2016-08-25 15:41:39 +02:00
Andrew Dudney
0f8a96d9b8
Changed over to the approx crate. Currently breaks rotation's doc tests.
2016-08-22 09:21:22 -06:00
Andrew Dudney
17d98af64f
Made uses of Rad<S> more generic using Into<Rad<S>>
2016-07-26 17:30:05 -07:00
Brendan Zabarauskas
7147180936
Merge pull request #359 from jminer/rotation-fixes
...
Rotation fixes
2016-05-18 00:19:43 +10:00
Romain Vaillant
cdbb9294e0
Adds serde support
2016-05-16 14:16:59 +02:00
Romain Vaillant
f3673a1d4c
makes rustc-serialize optional
2016-05-15 14:48:57 +02:00
Jordan Miner
c11371794f
Fix Euler angle to matrix conversion
...
The equations were written with rows horizontally instead of vertically
and some signs were wrong.
2016-05-12 01:28:16 -05:00
Jordan Miner
b56119a42f
Test converting axis angles to quaternions
2016-05-12 01:28:15 -05:00
Mark Hintz
074cb2c36f
Change the name of methods on the Transform trait to avoid clashes
...
Transform::invert becomes Transform::inverse_transform, and Transform::invert_self becomes Transform::to_inverse. Tests passing for me now
2016-05-01 14:59:38 +02:00
Mark Hintz
0a78173e2b
impl Transform (2 dimensional) for Matrix3
2016-04-28 16:37:36 +02:00
Mark Hintz
a3539483b6
impl Transform (3 dimensional) for Matrix3
2016-04-28 16:37:36 +02:00
Mark Hintz
ab1d3d8622
imple Transform (and Transform3) for Matrix4
...
The change in transform.rs is to disambiguate which invert function is used
2016-04-28 16:37:36 +02:00
Mark Hintz
c32135a5d9
Move the From impls together
2016-04-28 16:37:36 +02:00
Mark Hintz
808a17fc22
implement from_angle{x, y, z} and from_axis_angle for Matrix4
...
All are duplicates of the same functions for Matrix3, with extra parameters added in to make up the full 4x4
2016-04-28 01:03:33 +02:00
Brendan Zabarauskas
6b48236cb6
Inherit Zero and One for core structural traits
2016-04-25 15:26:56 +10:00
Brendan Zabarauskas
54adacc2a8
Re-export Zero and One via structure module
2016-04-25 11:43:28 +10:00
Brendan Zabarauskas
0259acb87f
Switch to an Euler angle type for defining rotations
2016-04-23 16:56:07 +10:00
Brendan Zabarauskas
86c13ca14f
Switch to using num_traits crate from num
...
Fixes #336
2016-04-23 14:03:35 +10:00
Brendan Zabarauskas
8dd2874b59
Move traits into common module
2016-04-19 20:51:40 +10:00
Brendan Zabarauskas
07301eb4d0
Stabilise assignment operators
...
Assignment operators were stabilised in Rust 1.8.
2016-04-16 10:09:47 +10:00
Brendan Zabarauskas
23fce928c0
Module documentation updates
2016-04-09 14:22:30 +10:00
Brendan Zabarauskas
a3e6cd26b5
Document fields
2016-04-09 13:47:17 +10:00
Brendan Zabarauskas
886e2fb240
Unify trait hierarchies for vectors, quaternions and matrices
2016-04-09 13:47:04 +10:00
Brendan Zabarauskas
b4063ea72a
Rename Point to EuclideanSpace
2016-04-08 19:56:30 +10:00
Brendan Zabarauskas
2b36ea2ef9
Rename Vector trait to VectorSpace and EuclideanVector to InnerSpace
2016-04-08 08:46:35 +10:00
Brendan Zabarauskas
f766973a74
Remove neg_self methods
...
These are a weird methods... they aren't associated with any traits. I think they were left-over from before we moved to operator impls.
2016-04-04 20:45:37 +10:00
Brendan Zabarauskas
3d55187a7d
Mark some types as #[repr(C, packed)]
...
Closes #296
2016-03-25 12:42:17 +11:00
Cameron Hart
24a21d5fc6
Added scalar arithmetic operators for Matrix types
2016-01-02 16:11:16 +11:00
Brendan Zabarauskas
429d2659fe
Improve fmt::Debug impls
2015-12-29 21:50:43 +11:00
Brendan Zabarauskas
0875ea4444
Merge pull request #284 from DerekBurch/fix-matrix3-to-quaternion
...
Fix conversion from Matrix3 to Quaternion
2015-12-23 13:12:03 +11:00
derekburch
744fb78662
Fix conversion from Matrix3 to Quaternion
2015-12-22 17:53:06 -08:00
Brendan Zabarauskas
59d5e6f53a
Implement most assignment operators
2015-12-22 22:34:34 +11:00
Brendan Zabarauskas
8c05db962a
Implement by-ref negations for matrices
2015-12-22 00:43:15 +11:00
Brendan Zabarauskas
23c632acca
Use SquareMatrix::ColumnRow instead of Matrix::Column
2015-12-21 22:10:28 +11:00
Brendan Zabarauskas
1d886f6197
Add all permutations of matrix ops, and remove operator methods
...
Completes #247
2015-12-21 21:02:40 +11:00
Brendan Zabarauskas
612be7fecc
Move free trigonometric functions onto Angle trait
2015-12-13 23:51:00 +11:00
Brendan Zabarauskas
25f5dfd5fc
Remove operator methods from Vector trait
2015-12-13 12:01:00 +11:00
Brendan Zabarauskas
74a771af79
Rename matrix scale functions for better ergonomics
...
Uniform scale matrices are probably the more common case. It probably makes sense that this has the shorter constructor.
2015-12-07 23:46:24 +11:00
Brendan Zabarauskas
f75c8aa7f1
Merge pull request #261 from bjz/add-matrix-scale-functions
...
Add matrix scale functions
2015-12-06 21:08:27 +11:00
Brendan Zabarauskas
1a291c720c
Simplify impl bounds
...
All the useful functions are implemented for BaseFloat, so it seems reasonable to not require such fine-grained impls. This should also make the generated documentation easier to read.
2015-12-06 19:53:23 +11:00
Brendan Zabarauskas
4f0aabb164
Clarify comments about the kind of matrices that are returned by the constructors
2015-12-06 19:53:23 +11:00