Commit Graph

334 Commits

Author SHA1 Message Date
Peter Nguyen fc10742b5c Change std::rand to rand in lower_triangular.rs 2014-03-13 19:35:01 -04:00
Peter Nguyen 503b567b27 Update to latest Rust.
Version of rustc: rustc 0.10-pre (4d64441 2014-03-12 15:07:06 -0700)
2014-03-13 18:20:04 -04:00
Peter Nguyen 7bc561c835 Update to latest rust.
`std::rand` was moved to it's own crate.
Version of rustc: rustc 0.10-pre (4d64441 2014-03-12 15:07:06 -0700)
2014-03-13 17:47:03 -04:00
Sébastien Crozet 13430866d4 Remove the DeepClone derivings.
Version of rustc: 0.10-pre (e959c87 2014-03-08 22:41:45 -0800)
2014-03-09 10:09:08 +01:00
Sébastien Crozet 57dfc14139 Update to the last Rust.
Version of rustc: 0.10-pre (4243cad 2014-02-24 22:17:02 -0800)
2014-02-25 09:41:41 +01:00
Sébastien Crozet c834439009 Update to the last rust.
Version of rustc: 0.10-pre (a5342d5 2014-02-23 22:06:50 -0800)
2014-02-24 11:48:02 +01:00
Sébastien Crozet ba32051fdf Add deriving `Hash` and `Show`. 2014-02-23 08:44:21 +01:00
Sébastien Crozet 9a49bb5895 Update to the last Rust.
Version of rustc: 0.10-pre (698042d 2014-02-21 21:26:49 -0800)
2014-02-22 09:09:04 +01:00
Sébastien Crozet 0eab5e0d4f Add free functions for partial ordering comparison operators. 2014-02-18 12:53:15 +01:00
Sébastien Crozet 9fb67f8125 Add more comparison default methods to the `PartialOrd` trait.
This allows for some optimization.
2014-02-18 12:48:52 +01:00
Sébastien Crozet becb77843e Update to the last Rust.
Version of rustc: 0.10-pre (b0ce960 2014-02-17 22:16:51 -0800)
This replaces uses of the `Orderable` trait by a `PartialOrd` trait: the `min` and `max` methods
are replaced by `inf` and `sup` methods.
Vectors do not implement the `Ord` trait any more.

Fix #4
2014-02-18 12:13:40 +01:00
Eduard Bopp 513fb33e4a Fix call to swap function due to upstream changes
Rust moved this function from std::util (which has been dissolved now) to std::mem.
2014-02-11 20:34:28 +01:00
Sébastien Crozet 96e77e4cfd Update to the last Rust.
Version of rustc: 0.10-pre (9a672f9 2014-02-05 18:31:36 -0800)
2014-02-06 08:59:27 +01:00
Sébastien Crozet 85c67b5544 Activate the unused_results lint. 2014-01-31 15:26:25 +01:00
Sébastien Crozet d50afdf645 Update to the last Rust.
Version of rustc: 0.10-pre (e3b1f3c 2014-01-29 23:46:26 -0800)
2014-01-30 11:28:15 +01:00
Sébastien Crozet 4c262bb91d Remove useless parenthesis. 2014-01-23 01:22:23 +01:00
Sébastien Crozet f018478117 Fix the doc root url. 2014-01-21 08:24:23 +01:00
Sébastien Crozet 836a0d40ae Modify `.travis.yml` to generate the documentation. 2014-01-21 08:13:10 +01:00
Sébastien Crozet 8de8c94b45 Update to the last Rust.
Version of rustc: 0.10-pre (d4640f9 2014-01-20 11:41:29 -0800)

This also removes the `PVec` type due to lack of use-case.
2014-01-20 23:41:22 +01:00
Sébastien Crozet 9dd8bb4ea2 Fix the documentation for `na::inv_translate`. 2014-01-19 16:22:58 +01:00
Sébastien Crozet 5463da79ae Make `make test` test the documentation examples too. 2014-01-19 16:16:12 +01:00
Sébastien Crozet 79008262cb Doc: fix some typos. 2014-01-19 15:49:32 +01:00
Sébastien Crozet cbebbe8961 Add the `html_doc_url` attribute. 2014-01-18 19:57:36 +01:00
Sébastien Crozet 197f7ff4d2 Update to the last Rust
Version of rustc: 0.10-pre (1da2962 2014-01-17 23:41:45 -0800)
Iterators were renamed.
2014-01-18 10:49:47 +01:00
Sébastien Crozet 096cce413f Update to the last Rust.
The `Bounded` trait is no longer on the Rust prelude.
2014-01-16 08:17:44 +01:00
Sébastien Crozet 98b2aa8b9c Revert "Update to the last Rust."
This reverts commit c1b91eefbb.

As a matter of fact, Bounded has not been deleted.
However it is no longer automatically exported by the stdlib.
2014-01-16 08:15:57 +01:00
Sébastien Crozet c1b91eefbb Update to the last Rust.
The `Bounded` trait does not exist any more.
2014-01-16 08:12:33 +01:00
Sébastien Crozet 3e41e18c32 Fix the example on the README. 2014-01-14 09:52:18 +01:00
Sébastien Crozet f026585b63 Fix the link to the online documentation. 2014-01-14 09:48:03 +01:00
Sébastien Crozet 87c0d5b769 Make the `struct` and `traits` modules private.
Now that the documentation of public export of private modules is inlined on the exporter's
documentation, there is non need to export anything but the `na` module.
2014-01-14 09:40:12 +01:00
Sébastien Crozet 1672e9e5d2 Inline the default implementation of approx_eq 2014-01-09 20:53:01 +01:00
Sébastien Crozet f5b0b76d8d Add the ApproxEq trait.
It is no longer part of std::num
2014-01-09 20:48:30 +01:00
Sébastien Crozet 31904cad6f Add a `perspective3d` free function on the na:: module. 2014-01-01 14:44:51 +01:00
Sébastien Crozet db831f922e Update to the last Rust. 2013-12-24 11:46:16 +01:00
Sébastien Crozet effb1632d1 Update to the last Rust: pkgid -> crate_id 2013-12-20 12:55:15 +01:00
Jan Niklas Hasse 396d394ab9 Use new std::vec functions 2013-12-16 12:04:02 +01:00
Sébastien Crozet e25bac3565 Fix pkgid. 2013-12-12 18:08:05 +01:00
Sébastien Crozet f83ddde824 Update to the last Rust.
This renames lib.rs to nalgebra.rs so that the generated *.so has the right name.
2013-12-11 16:32:03 +01:00
Sébastien Crozet 1e71dc1d0a Add unchecked access to vector components on the Indexable trait. 2013-12-01 20:17:18 +01:00
Sébastien Crozet 15d12e5322 Implement AbsoluteRotate for Identity. 2013-11-28 20:14:25 +01:00
Sébastien Crozet 930ff81f3b Implement AbsoluteRotate for Identity. 2013-11-28 20:11:10 +01:00
Sébastien Crozet b244975f93 Update to the last Rust. 2013-11-27 11:24:29 +01:00
Sébastien Crozet 9e7a623d99 Start implementation of quaternions. 2013-11-25 15:31:46 +01:00
Sébastien Crozet 0523e1c701 Add a free function to prepend a rotation. 2013-11-24 23:56:44 +01:00
Sébastien Crozet 4addd531cf Add incomplete implementation of 4D rotation. 2013-11-22 09:46:48 +01:00
Sébastien Crozet 4b03e2de95 Replace std::num::One::one() by std::num::one() on examples. 2013-10-18 11:59:32 +02:00
Sébastien Crozet 8423286911 Switch to column-major representation.
Matrices are now column-major.
This will be useful to interop with opengl and lapack.
2013-10-17 22:40:44 +02:00
Sébastien Crozet 90e40aaec0 Make most out-of-place methods static.
This is to make people prefer the functional style.
Things like `a.dot(b)` dont make sense per se (there is no reason for `a` to have a different
status than `b`). Using static methods avoid this.

In-place methods are left unchanged.
2013-10-16 21:44:33 +02:00
Sébastien Crozet dcd1e7719b Add methods to access a DVec<N> as a &[N]. 2013-10-14 15:38:23 +02:00
Sébastien Crozet bb5654d220 Remove free-functions alliasing structures constructors.
Those constructors are not idiomatic. Use e.g. `Vec3::new(0, 0, 0)` instead.
2013-10-14 11:22:38 +02:00
Sébastien Crozet ccbc8b4429 Api change: deal with inplace/out of place methods.
Before, it was too easy to use an out of place method instead of the inplace one since they name
were pretty mutch the same. This kind of confusion may lead to silly bugs very hard to understand.
Thus the following changes have been made when a method is available both inplace and out-of-place:

* inplace version keep a short name.
* out-of-place version are suffixed by `_cpy` (meaning `copy`), and are static methods.

Methods applying transformations (rotation, translation or general transform) are now prefixed by
`append`, and a `prepend` version is available too.

Also, free functions doing in-place modifications dont really make sense. They have been removed.

Here are the naming changes:
* `invert` -> `inv`
* `inverted` -> `Inv::inv_cpy`
* `transpose` -> `transpose`
* `transposed` -> `Transpose::transpose_cpy`
* `transform_by` -> `append_transformation`
* `transformed` -> `Transform::append_transformation_cpy`
* `rotate_by` -> `apppend_rotation`
* `rotated` -> `Rotation::append_rotation_cpy`
* `translate_by` -> `apppend_translation`
* `translate` -> `Translation::append_translation_cpy`
* `normalized` -> `Norm::normalize_cpy`
* `rotated_wrt_point` -> `RotationWithTranslation::append_rotation_wrt_point_cpy`
* `rotated_wrt_center` -> `RotationWithTranslation::append_rotation_wrt_center_cpy`

Note that using those static methods is very verbose, and using in-place methods require an
explicit import of the related trait.

This is a way to convince the user to use free functions most of the time.
2013-10-14 10:42:07 +02:00
Sébastien Crozet 20bdbb6408 Dont re-export std::num::{Zero, One}.
This is useless.
2013-10-10 00:45:56 +02:00
Sébastien Crozet c352452bcb Remove unused import. 2013-10-10 00:26:07 +02:00
Sébastien Crozet 7667d8f19a Add a double-trait-dispatch-trick based cast trait
The Cast trait replaces both MatCast and VecCast.
2013-10-09 23:10:43 +02:00
Sébastien Crozet 2a4807262a Re-export the Identity type properly. 2013-10-08 21:00:45 +02:00
Sébastien Crozet 63e6474d40 Re-add look_at methods for isometries. 2013-10-08 21:00:25 +02:00
Sébastien Crozet 1c0b60c3ef Add a link to the on-line documentation. 2013-10-08 02:10:35 +02:00
Sébastien Crozet d25534610d Add a one-line description to each free-function.
This is better than nothing.
2013-10-08 01:59:15 +02:00
Sébastien Crozet edf17b5667 Update to the last Rust.
Also use free-functions on tests.
2013-10-08 01:22:56 +02:00
Sébastien Crozet 3f99bd62c6 Use `use` instead of `pub use` to import modules on the examples. 2013-10-06 19:36:59 +02:00
Sébastien Crozet ee2db8da99 Add the "nalgebra in use" part to the readme. 2013-10-06 19:32:31 +02:00
Sébastien Crozet d0267f5071 Fix the example given by the readme. 2013-10-06 19:28:52 +02:00
Sébastien Crozet 84212f1449 Huge api change!
Everything changed, hopefully for the best.

* everything is accessible from the `na` module. It re-export
  everything and provides free functions (i-e: na::dot(a, b) instead of
  a.dot(b)) for most functionalities.
* matrix/vector adaptors (Rotmat, Transform) are replaced by plain
  types: Rot{2, 3, 4} for rotation matrices and Iso{2, 3, 4} for
  isometries (rotation + translation).  This old adaptors system was to
  hard to understand and to document.
* each file related to data structures moved to the `structs` folder.
  This makes the doc a lot more readable and make people prefer the
  `na` module instead of individual small modules.
* Because `na` exists now, the modules `structs::vec` and
  `structs::mat` dont re-export anything now.

As a side effect, this makes the documentation more readable.
2013-10-06 18:07:17 +02:00
Sébastien Crozet 2356723e90 Add some impls for 4d rotations.
It is not possible to create a 4d rotation yet.
2013-10-03 23:58:36 +02:00
Sébastien Crozet 820790bfa9 Add pointwise multiplication and division for vectors. 2013-10-03 18:25:57 +02:00
Sébastien Crozet b364920d9b Move the Round trait inheritance from VecExt to AlgebraicVecExt.
What it the point of rounding an integer-valued vector?
2013-10-03 00:57:43 +02:00
Sébastien Crozet d4ee651305 Move the Basis trait inheritance from VecExt to AlgebraicVecExt.
The Basis trait cannot be implemented if the vector is not algebraic anyway.
2013-10-03 00:45:50 +02:00
Sébastien Crozet a54c42229b Update to the last Rust: remove the float type. 2013-10-02 11:52:10 +02:00
Sébastien Crozet c344be7351 Minor doc improvements. 2013-09-26 17:19:42 +02:00
Sébastien Crozet b61d621090 Update to the last Rust. 2013-09-26 17:05:11 +02:00
Sébastien Crozet 410bbd1d25 Update to the last Rust api.
RngUtils is dead.
rustdoc_ng became rustdoc.
2013-09-22 21:12:50 +02:00
Sébastien Crozet 4ffe274b03 Add mean and covariance computation for DMat.
This also fixes the transposition for rectangular DMat, and add scalar
addition/subtraction/multiplication/division for DMat.
2013-09-22 15:47:53 +02:00
Sébastien Crozet 7de844b46a Moved some files + use rustdoc_ng to generate the documenatiton.
Trait failes are merged in three files:
    * operations.rs - for low-level matrix/vector operations
    * geometry.rs   - for operations with a clear, broadly known geometric meaning.
    * structure.rs  - for operations to access/alter the object inner structures.

Specialisations are moved to the `spec` folder.
2013-09-22 11:05:15 +02:00
Sébastien Crozet 9a9de20b8a Remove the redundant `Column` trait + Add unchecked access indexing to dynamic matrices/vectors. 2013-09-20 22:17:55 +02:00
Sébastien Crozet c89a6681c1 Fix broken 2d rotation. 2013-09-15 11:51:42 +02:00
Sébastien Crozet 6dc8139794 "Remove" the RMul and LMul trait. Use the regular Mul trait.
Those traits are not really removed since they are useful on generic code (to work around curret
limitations of rust traits system).
2013-09-15 11:18:06 +02:00
Sébastien Crozet 514bf74efe "Replaced" Scalar{Add, Sub, Mul, Div} by operator overloading.
Those traits are not really removed since rust cannot handle those multiple operator overloading
very well yet, making them sometimes unuseable on generic code.
2013-09-14 21:32:38 +02:00
Sébastien Crozet e3a1d56e58 Set up the hack to allow better overloads of the Mul trait.
This is strongly inpired by
http://smallcultfollowing.com/babysteps/blog/2012/10/04/refining-traits-slash-impls/
2013-09-14 17:08:48 +02:00
Sébastien Crozet 06c7293e83 Specialized Mul, RMul, and LMul for Mat2 and Mat3. 2013-09-14 11:07:52 +02:00
Sébastien Crozet 1a08262f50 More unsafe indexing in inner loops and add some benchmarks. 2013-09-14 00:08:46 +02:00
Sébastien Crozet 72395f3546 Add an unsafe `at_fast` method for unchecked read access to DVec and DMat. 2013-09-13 11:32:30 +02:00
Sébastien Crozet 3b814b462f Add unsafe methods to initialize a DVec or DMat without initialization. 2013-09-13 11:11:04 +02:00
Sébastien Crozet 05470bba90 Add a `new_random` method to build a `DMat` or `DVec` filled with random numbers. 2013-09-13 10:56:25 +02:00
Sébastien Crozet 1cf3506e06 Remove some useless #[test] tags. 2013-09-13 10:34:49 +02:00
Sébastien Crozet 6f81fc6d5c Add `Absolute`, `Col`, `Mat`, `AbsoluteRotate` traits.
Traits like `AbsoluteRotate` and `RotationWithTranslation` have been moved to a `comp` folder
containing any trait providing operations which are combination of several traits.
2013-09-13 10:26:19 +02:00
Sébastien Crozet 00f26f8951 Replace std::iterator by std::iter. 2013-09-09 11:19:54 +02:00
Sébastien Crozet ea98ef15b7 Implement `Norm` and `Dot` for `DVec`. 2013-09-08 18:29:51 +02:00
Sébastien Crozet bdf82748dc Add a `Dot` and a `Norm` trait for vectors having a dot product and a norm.
Those methods are not part of the `Vec` and `AlgebraicVec` traits any more.
2013-09-08 18:20:06 +02:00
Sébastien Crozet 37f0b123e0 Make the dot-product and normalization related methods public for DVec.
This will change soon with two traits: Dot and Norm.
2013-09-08 18:00:28 +02:00
Sébastien Crozet 992adb99f0 Add a `Container` implementation for every vector. 2013-09-08 17:26:31 +02:00
Sébastien Crozet 57b89b38df Add `nrow()`, `ncols()` methods for `DMat`, and Container impl. for `DVec`. 2013-09-08 17:19:50 +02:00
Sébastien Crozet 3ab06faef6 Implement `UnitSphereSample` for `Vec1`. 2013-09-08 16:03:03 +02:00
Sébastien Crozet 6147d5424e Implement 3d rotation matrix -> axis angle conversion.
Cornercases are not handled correctly yet.
2013-09-08 15:45:32 +02:00
Sébastien Crozet 4e33b96aec Update to the last rust. 2013-09-07 17:26:05 +02:00
Sébastien Crozet 8db01c6409 Add more functions to initialize DMat and DVec. 2013-09-07 08:43:17 +02:00
Sébastien Crozet a00860df41 Reexport `DMat` in mat.rs and `DVec` in vec.rs. 2013-09-07 08:23:09 +02:00
Sébastien Crozet 0be1132452 Swap the type parameters of `Transform`. 2013-09-06 15:22:14 +02:00
Sébastien Crozet 2ccd62d558 Add methods to set the translation/rotation/transformation directly. 2013-09-06 08:48:08 +02:00
Sébastien Crozet a0b232be0a Rename `Mat4::projection` to `mat4::new_perspective`. 2013-09-05 13:45:11 +02:00
Sébastien Crozet 628066cdc8 Make DMat able to represent rectangular matrices.
The code is largely untested.
2013-09-05 00:01:52 +02:00
Sébastien Crozet 8973e0d67c Add function to create a projection matrix. 2013-09-04 23:29:58 +02:00
Sébastien Crozet 539e34c2bf Move all the rotation-related free functions to a `RotationWithTranslation` trait.
This is not a very good name though.
2013-09-04 17:07:56 +02:00
Sébastien Crozet 70cee0ea3d Rename the main module lib.rs.
This is a first step toward the use of rustpkg.
2013-08-31 18:33:20 +02:00
Sébastien Crozet a40899ef67 Add missing rotation-related functions. 2013-08-31 17:17:18 +02:00
Sébastien Crozet 9ecafc5cdf Dont use globing `pub use`, they are buggy. 2013-08-31 17:14:41 +02:00
Sébastien Crozet f762891ecf Move the `Outer` product trait to vec.rs 2013-08-31 12:23:26 +02:00
Sébastien Crozet a5a616e05e Make the `traits` module private.
Use `vec::Whatever` or `mat::Whatever` instead of `traits::whatever::Whatever`.
2013-08-31 12:16:53 +02:00
Sébastien Crozet 1b31304a9e 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.
2013-08-31 11:41:32 +02:00
Sébastien Crozet eb4e4a6aeb Add a PVec3 type, for Padded Vector 3d.
This is the same as Vec3 but with an extra field for padding. This is useful for applications
needing a power-of-two number of arguments (typically mixed CPU/GPU applications).

The corresponding matrix is not yet implemented.
2013-08-31 11:13:17 +02:00
Sébastien Crozet 346a803b7f Improve how the dummy parameter are passed to the Dim::dim function. 2013-08-30 09:53:17 +02:00
Sébastien Crozet 82ddda154f Update to work with the last compiler.
Because of the unfortunate changes on type parameters resolution:
        - the Dim trait now needs an useless parameter to infer the Self type.
        - ApproxEps::epsilon() is broken.
2013-08-28 14:22:12 +02:00
Sébastien Crozet f465928085 Fix Transform adaptor ToHomogeneous implementation. 2013-08-26 17:39:25 +02:00
Sébastien Crozet 7052aa88ee Add two traits: `CrossMatrix` and `Row`.
CrossMatrix is a trait for vectors having a cross product representable as a matrix.
Row is a trait for Matrixces and Vectors, to access (by index) their rows.
2013-08-25 23:01:44 +02:00
Sébastien Crozet 4635d6ebac Add Rotate, Transform, Translate impl for vectors. 2013-08-23 16:29:08 +02:00
Sébastien Crozet 833378d83f Add and `Identity` matrix type.
It implements most matrix traits but all its operations are no-ops.
2013-08-23 15:59:26 +02:00
Sébastien Crozet 6999444575 Merge the Rotatable, Translatable, Transformable traits with their corresponding Rotation, Translation, Transformation. 2013-08-22 17:47:37 +02:00
Sébastien Crozet 347883caa1 Rework of the traits for Vectors.
The goal is to make traits less fine-grained for vectors, and reduce the amount of `use`.

- Scalar{Mul, Div} are removed, replaced by Mul<N, V> and Div<N, V>,
- Ring and DivisionRing are removed. Use Num instead.
- VectorSpace, Dot, and Norm are removed, replaced by the new, higher-level traits.

Add four traits:
- Vec: common operations on vectors. Replaces VectorSpace and Dot.
- AlgebraicVec: Vec + the old Norm trait.
- VecExt: Vec + every other traits vectors implement.
- AlgebraicVecExt: AlgebraicVec + VecExt.
2013-08-18 18:33:25 +02:00
Sébastien Crozet cead4f8410 Moved DivisionRing to ring.rs. 2013-08-17 17:50:01 +02:00
Sébastien Crozet 344d761be5 Add the ability to stop the basis internal itertors. 2013-08-17 10:48:45 +02:00
Sébastien Crozet d8db04cce5 Changed the UniformSphereSample trait to return a borrowed vector. 2013-08-16 18:08:51 +02:00
Sébastien Crozet 61e985634b Fix FromIterator impl. 2013-08-16 10:14:01 +02:00
Sébastien Crozet 5187a1a73f Add `Round` impl for vectors. 2013-08-15 10:41:47 +02:00
Sébastien Crozet a69f43bccd Remove some unneded visibility modifiers. 2013-08-14 09:43:02 +02:00
Sébastien Crozet 24e1862a9e Fix to work with the last Rust deriving. 2013-08-13 10:57:19 +02:00
Sébastien Crozet a46b063192 Add Scalar{Mul, Div, Add, Sub} for matrices. 2013-08-12 17:04:53 +02:00
Sébastien Crozet 037cf95542 Add (pointwise) Add and Sub impl for matrices. 2013-08-12 16:50:50 +02:00
Sébastien Crozet b08a8384ae Add outer product. 2013-08-12 16:45:31 +02:00
Sébastien Crozet 3858c63291 Update to work with the last Rust api. 2013-08-11 16:07:34 +02:00
Sébastien Crozet 50a6454ae8 Add missing #[inline] hints. 2013-08-07 20:53:51 +02:00
Sébastien Crozet efd14f9e88 Further coding style fixes. 2013-08-05 10:15:11 +02:00
Sébastien Crozet c59911168e Fix curly braces. 2013-08-05 10:13:44 +02:00
Sébastien Crozet a810bf6008 Indentation fixes. 2013-08-05 09:44:56 +02:00
Sébastien Crozet 53a5dbb6e3 Add `Orderable` implementation for vectors.
The `min`, `max` and `clamp` methods are component-wise.
2013-08-04 11:06:23 +02:00
Sébastien Crozet 9af1cac45d Fix `Ord` implementations to be a partial order.
When two elements are not comparable, all comparison operators return `false`.
2013-08-04 10:36:35 +02:00
Sébastien Crozet 50b34ca765 Fix `for` loops (again) + `iterate` becomes `range`. 2013-08-03 12:21:56 +02:00
Sébastien Crozet 7b2dbb244e Fix `for` loops. 2013-08-02 10:50:04 +02:00
Sébastien Crozet 3f3f59e8eb Changed mod visibilities + add doc for types.rs 2013-08-01 18:55:42 +02:00
Sébastien Crozet 67dea17abe for ... advance -> foreach ... in 2013-08-01 09:18:21 +02:00
Sébastien Crozet 164ff5b1b2 Add missing type bounds. 2013-07-25 14:50:55 +02:00
Sébastien Crozet 4f3de703b7 Add static methods to build canonical axis.
For exemple use: Vec3::x() to create the vector Vec3::new(1.0, 0.0, 0.0).
The same aplies for y, z, w, etc.
2013-07-24 23:54:54 +02:00
Sébastien Crozet e75fe80966 Add documentation. 2013-07-24 16:50:40 +02:00
Sébastien Crozet 6cf8db0926 Replaced all remaining ocurences of from_homogeneous by from 2013-07-23 23:28:02 +02:00
Sébastien Crozet 321574a827 from_homogeneous -> from 2013-07-23 23:26:47 +02:00
Sébastien Crozet 93597f0ef9 Add look_at_z.
Having a look_at which aligns the z-axis with the look_at direction is useful for cameras. It
will exist only in 3d.
2013-07-23 18:41:57 +02:00
Sébastien Crozet 8634b9037d Changed the semantic of the look_at method.
Before, the `look_at` method aligned the `z` axis with the look_at direction.
This will be problematic in the future if we want to generalize that on n-dimension (the z axis
could not axis at all when n < 3).
Now, the `look_at` method aligns the `x` axis with the look_at direction. Thus we have a chance for
it to be generalizable on n-dimension, `n >= 1`.
2013-07-23 12:12:03 +02:00
Sébastien Crozet 4ea1dd92e6 Fixed transposition. 2013-07-23 11:15:20 +02:00
Sébastien Crozet cd2aeb4861 Fix look_at. 2013-07-23 01:06:20 +02:00
Sébastien Crozet e2f34023ed Add traits MatCast and VecCast.
VecCast casts a Vec<N1> to a Vec<N2> with N1 and N2 bounded by NumCast.
MatCast casts a Mat<N1> to a Mat<N2> with N1 and N2 bounded by NumCast.
2013-07-22 23:42:35 +02:00
Sébastien Crozet 81389a911a Add utility methods.
Added look_at for 3d rotation matrix and 3d transform.
Rotation matrices constructors are now the static methods Rotmat::from_angle,
Rotmat::from_axis_angle.
2013-07-22 23:20:03 +02:00
Sébastien Crozet 0577f3e364 Add type aliases. 2013-07-22 13:44:08 +02:00