Commit Graph

50 Commits

Author SHA1 Message Date
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
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
3858c63291 Update to work with the last Rust api. 2013-08-11 16:07:34 +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
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
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
cd2aeb4861 Fix look_at. 2013-07-23 01:06:20 +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
3a64e05c62 Merged the {vec, mat} and {vec, mat}_impl modules. 2013-07-22 11:35:36 +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
8918cb5d7e invert -> inplace_inverse to avoid name clash with iterators. 2013-07-13 13:34:41 +00: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
6fd9696253 Fix bug when trying to create a rotation matrix with a zero angle. 2013-06-30 21:19:36 +00:00
Sébastien Crozet
50293ca417 Add read-only access to a Rotmat subcomponents. 2013-06-29 18:37:01 +00:00
Sébastien Crozet
364c16ca19 Add read-only accesse to a Transform subcomponents. 2013-06-29 18:35:01 +00:00
Sébastien Crozet
50d424a901 Changed the representation of rotations for 3D matrix. 2013-06-29 15:32:56 +00:00
Sébastien Crozet
8e8a87b667 Fixes to work with the new compiler. 2013-06-29 12:06:39 +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
c54eb562ec Refactor code for matrices. 2013-06-28 22:55:09 +00:00
Sébastien Crozet
cd355dfb30 Refactor vec{1, 2, 3} implemenation + add some useful traits. 2013-06-28 21:03:40 +00:00
Sébastien Crozet
8abcdeeedc #[inline(always)] -> #[inline] 2013-06-27 17:40:37 +00:00
Sébastien Crozet
6723693b49 Refined traits for rotation/translation/transformation. 2013-06-27 16:16:07 +00:00
Sébastien Crozet
ffbcf4882a Removed a lot of Copy + made Rotation and Translation more flexible. 2013-06-26 20:56:30 +00:00
Sébastien Crozet
edc5bb616d Removed some useless references. 2013-06-24 21:38:52 +00:00
Sébastien Crozet
cfd7bac305 Fix to make it work with the new compiler. 2013-06-19 12:26:59 +02:00
Sébastien Crozet
caee7eb423 workarounds -> traits. All ICE are now compiler errors. 2013-06-15 20:16:44 +00:00
Sébastien Crozet
513d4d7b08 Add inlining pragmas. 2013-06-13 16:48:28 +00:00
Sébastien Crozet
4cc5b178c8 Add DeltaTransformVector tait and fix transformation. 2013-06-13 14:44:15 +00:00
Sébastien Crozet
c02edb9d09 Used a better type parametter name. 2013-06-09 23:36:47 +00:00
Sébastien Crozet
ec87e81426 Relaxed type constraints for transform rotation. 2013-06-08 16:33:49 +00:00
Sébastien Crozet
8a1b81f839 Primitive construction is more idiomatique using new. 2013-06-08 10:09:17 +00:00
Sébastien Crozet
0b8058e88f Adapted for the compiler 'incomming' branch. 2013-06-01 20:50:00 +02:00
Sébastien Crozet
a77013e4c7 Use automatic ToStr deriving for everything. 2013-05-25 18:30:03 +00:00
Sébastien Crozet
3fa933d13f Add comments and adapted to new rust syntax. 2013-05-21 22:46:33 +00:00
Sébastien Crozet
4312daa53c Removed the triginometric trait workaround. 2013-05-20 10:02:02 +00:00
Sébastien Crozet
b2d17300d9 Add delta-transformation implementations. 2013-05-19 19:45:30 +00:00
Sébastien Crozet
ec160e5219 Fix rotation for transform adaptor. 2013-05-19 15:01:38 +00:00
Sébastien Crozet
dc0757b2e5 Add rotation and translation traits. 2013-05-19 11:44:27 +00:00
Sébastien Crozet
ceed733e25 Functions to build objects dont shadow constructors any more. 2013-05-18 20:03:45 +00:00
Sébastien Crozet
bc93c44206 Add Rand implementation for everything. 2013-05-18 00:11:59 +00:00
Sébastien Crozet
53131731b3 Add fuzzy_eq implementation for everything. 2013-05-16 22:23:25 +00:00
Sébastien Crozet
d636fdd346 Add matrix adaptors and addapted to the now rust features. 2013-05-16 21:30:39 +00:00