* 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
This makes the Matrix3/4 and Decomposed `look_at_*` functions consistent
with looking at a center/focus point and `look_to_*` functions consistent
with looking in a direction.
Corresponding functions have been added to Matrix4 and Decomposed
and are now consistent.
Matrix3, Matrix2, and the Rotation trait are only partially updated.
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.
* 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
* removed assertion for inverted near far
* added extra assertion
* adding checks for ratio too small or far and near plane too close to each other
* using comparing macro
* PR feedback
491: Fix Matrix2::look_at, add look_at_stable r=kvark a=blargg
## Changes
1. Fixes `Matrix2::look_at`
2. Adds tests for `look_at`
3. Adds a new function, `look_at_stable`
## Notes
I added a new function for 2d look at rotation. `look_at` is a bit weird in practice for 2d. For example, if you are making a basis matrix to orient a 2d character to look at a point, `look_at` will flip the character as they rotate past `up` or `-up` vectors. This is the best match for what look_at is supposed to do, I think.
`look_at_stable` will not flip based on orientation, you just pass in which way to flip. This is a bit easier to use to rotate 2d characters.
`look_at_stable` could have a better name. I think we can also consider removing the flip param, and just let the user flip the matrix with a transform later.
Co-authored-by: blargg <tomjankauski@gmail.com>
483: Make `rand` dependency optional (but enabled by default) r=kvark a=LukasKalbertodt
Closes#481
This PR leaves the feature enabled by default so that this can be released as a minor version soon. (I would suggest to disable it by default in future versions, but that's another discussion.)
The changes are pretty straight forward with one catch: I changed some `use` statements to nested imports (otherwise, there would be even more `#[cfg(feature = "rand")]` lines). Nested imports were stabilized in 1.25 (see [the edition guide on this feature](https://doc.rust-lang.org/edition-guide/rust-2018/module-system/nested-imports-with-use.html)). I'm not sure how cgmaths policy on minimum compiler version is. Maybe cgmath already requires a >= 1.25 compiler for other reasons. If my change is a problem, just tell me and I will change the imports back.
Co-authored-by: Lukas Kalbertodt <lukas.kalbertodt@gmail.com>
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.
476: Add short constructors for points, to match the ones for vectors r=kvark a=nstoddard
In my code I find that I need to create points almost as often as vectors, so having short constructors is helpful.
Co-authored-by: Nathan Stoddard <nstoddard@users.noreply.github.com>
472: [breaking] Move lerp() from InnerSpace to VectorSpace r=Rhuagh a=Vlad-Shcherbina
Because it does not require dot product.
Along the way, fix the comment.
Fixes#471.
Co-authored-by: Vlad Shcherbina <vlad.shcherbina@gmail.com>
Also add const to a vector constructor that I missed before.
Constructors for other types can't yet be const, because the compiler gives an error: "trait bounds other than `Sized` on const fn parameters are unstable".