Commit graph

151 commits

Author SHA1 Message Date
Andrei Jardan
d4d19b9122 Implement IntoMint trait for Vectors, Points, Matrices, and Quaternions
- Updated mint to 0.5.8, so that the IntoMint trait is available
- Implemented IntoMint for Vectors, Points, Matrices, and Quaternions
2021-11-25 13:45:53 +02:00
Shane Pearman
af127633cc Replace use of BaseFloat/Float with BaseNum/Num where possible 2021-08-11 12:07:57 -04:00
Dana Jansens
e57b543449
Update links in quaternions.rs (#535)
* Update link to Arcsynthesis tutorial about quaternions

The old link no longer goes to a valid page, and it appears to be malicious.

* Fix links in quaternion.rs

Don't split the line between the [text] and (url) or they don't get turned into a link in docs.rs
2021-07-06 01:43:28 -04:00
Rémi Lauzier
575c458705 cargo fmt 2021-06-15 21:34:40 -04:00
Rémi Lauzier
fb205c0fc9 Fix some clippy warnings 2021-06-15 21:34:40 -04:00
Adam Gausmann
ada4add5a7
More Into impls converted to From (#529)
* More Into impls converted to From

* Update quaternion.rs
2021-04-20 22:17:06 -04:00
aloucks
8e0d5ece92
Fix deprecation warnings (#522) 2020-12-05 18:41:30 -05:00
aloucks
164808eebc
Quaternion memory layout changed to [x, y, z, w] (#500)
The `From` and `Into` impls for `[S; 4]` and `(S, S, S, S)` have been
changed accordingly. This is consistent with other libraries like glm,
nalgebra, and glam, as well as the glTF spec.

Note that the `Quaternion::new` constructor has **not** yet been
updated.
2020-11-23 11:22:21 -05:00
josh65536
84da664455
Now there is only one one (#513)
* Now there is only one one

* Rotation no longer has a parameter

* Moved some type parameters to associated types

* Relaxed some bounds and simplified a bound

* Removed unnecessary bound in

* Deduplicated multiplication code
2020-08-12 15:05:38 -04:00
josh65536
816c043223
Fixed opposite quaternion slerp bug (#515)
* Fixed opposite quaternion slerp bug

* Removed an unnecessary

* nlerp and slerp always take the shortest path now
2020-08-11 23:04:27 -04:00
Andrea Catania
ff1cda766d Code formatted with 2019-11-05 07:16:38 +01:00
Norbert Nemec
153754eb38 split off code into quaternion_simd.rs 2019-09-01 21:04:05 +02:00
Norbert Nemec
f21232a123 drop redundant copies from quaternion.rs 2019-09-01 21:04:05 +02:00
Norbert Nemec
64fde2002b replace default -> default_fn!() 2019-09-01 21:04:04 +02:00
Norbert Nemec
1c7c889921 drop redundancy of impl_operator_default and impl_assignment_operator_default 2019-09-01 21:04:04 +02:00
Lukas Kalbertodt
4bd8ebb38d
Make rand dependency optional (but enabled by default)
Most users probably don't use the rand impls, so the `rand` crate pulls
a large number of dependencies into the dependency tree which is just
wasted compilation time.
2019-05-02 11:24:50 +02:00
Michael Tang
c1f808d928 Add documentation for <Quaternion as Rotation<Point3<S>>>::rotate_vector. Fixes #479. 2019-03-22 22:01:47 -07:00
Nathan Stoddard
c438536dac Declare the rest of the constructors to be const
This requires removing trait bounds from the constructors, and for Euler, removing the trait bound from the struct.
2019-01-13 22:42:16 -08:00
Victor Koenders
cdb0e8c8a1 Bumped rand and fixed compiler issues 2018-06-08 13:39:02 +02:00
Alex Butler
a3965d414d
Update approx -> 0.2 2018-05-23 12:43:52 +01:00
Richard Dodd
f8e92ed327 Add is_finite to array and quaternion 2018-04-29 14:21:42 +01:00
Brendan Zabarauskas
574dd3b972 Run rustfmt on most files 2018-01-03 13:16:40 +11:00
Martin Lindhe
2acb4a968a fix some typos 2017-11-19 13:30:15 +01:00
Osspial
a6abd5bf02 Modify cast() functions to return Option 2017-08-16 16:21:51 -04:00
Brendan Zabarauskas
343361a0d6 Merge pull request #418 from kvark/mint2
Mint flavour integration
2017-07-30 22:47:59 +10:00
Owen Sanchez
51b3d2d477 Add cast method to Quaternion 2017-07-13 12:24:30 -07:00
Dzmitry Malyshau
d72fc08826 Mint flavour 2017-06-06 18:07:38 -04:00
Dzmitry Malyshau
7a21125c55 Refined serde dependencies 2017-06-06 16:48:55 -04:00
Dzmitry Malyshau
087336d0c0 Refinded simd feature 2017-06-06 16:44:13 -04:00
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
Brendan Zabarauskas
b73180e908 Workaround compilation error on nightly rust 2017-04-14 23:36:02 +10:00
andystanton
cd9e873739 Fix between_vectors for opposite vectors 2017-04-14 00:23:02 +01:00
Dimitri Sabadie
06bf49eee5 Added dots at end of some phrases. 2017-03-21 00:10:38 +01:00
Luxko
194c4770e9 add basic SIMD support for Quaternion<f32> 2017-03-12 20:44:58 +08: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
Dzmitry Malyshau
55c212bde1 Styling fixes to the quaternion arc code 2016-07-05 21:30:13 -04:00
Dzmitry Malyshau
f555074a44 Quaternion closest arc 2016-07-03 00:23:46 -04: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
467e87f3d3 Fix Euler angles to quaternion conversion and vise versa
Add tests that rotate a vector in all three axes, and tests to check
the axis rotation sequence.
2016-05-12 01:28:15 -05:00
Brendan Zabarauskas
a1d8eaed10 Make Rotation trait depend on One 2016-05-12 08:36:34 +10:00
Mark Hintz
ec3385ceab Remove unused imports
Fixes compile warnings
2016-05-11 13:21:56 +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