Commit Graph

19 Commits

Author SHA1 Message Date
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
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
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
3a64e05c62 Merged the {vec, mat} and {vec, mat}_impl modules. 2013-07-22 11:35:36 +02:00
Sébastien Crozet
ff24f70332 Flattened the traits submodules. 2013-07-22 10:26:20 +02:00
Sébastien Crozet
ae74a05fdd Add implementation of Vec0. 2013-07-20 16:32:39 +02:00
Sébastien Crozet
cf216f9b90 Removed occurences of copy/Copy + improved api.
Now, access to vector components are x, y, z, w, a, b, ... instead of at[i].
The method at(i) has the same (read only) effect as the old at[i].

Now, access to matrix components are m11, m12, ... instead of mij[offset(i, j)]...
The method at((i, j)) has the same effect as the old mij[offset(i, j)].

Automatic implementation of all traits the compiler supports has been added on the #[deriving]
clause for both matrices and vectors.
2013-07-20 15:07:49 +02:00
Sébastien Crozet
c37d58f3fb Add Vec0. 2013-07-07 22:34:18 +02:00
Sébastien Crozet
831f561441 Use Clone instead of Copy. 2013-07-05 22:54:42 +00:00
Sébastien Crozet
6f081b70b8 Add sphere sempling trait + Copy becomes Clone 2013-07-04 14:23:08 +00:00
Sébastien Crozet
3bb470ac95 Add Column + Homogeneous + Indexable traits.
Column: to access a matrix column.
Homogeneous: to convert a matrix/vector from/to homogenous coordinates.
Indexable: to access a matrix/vector element using indices.
2013-06-29 11:40:31 +00:00
Sébastien Crozet
c58e1ed40d Reorganized files. 2013-06-29 00:34:45 +00:00
Sébastien Crozet
cd355dfb30 Refactor vec{1, 2, 3} implemenation + add some useful traits. 2013-06-28 21:03:40 +00:00