Changes between Version 3 and Version 4 of doc/dev/beginners


Ignore:
Timestamp:
Jan 14, 2015, 2:59:53 PM (7 years ago)
Author:
sam
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • doc/dev/beginners

    v3 v4  
    33There are some tasks that do not require enormous amounts of work or engine knowledge. We try to summarise them here.
    44
    5 == Legacy methods in `array.h` and `string.h` ==
     5== Task: Legacy methods in `array.h` and `string.h` ==
    66
    7 ** Difficulty: 0/5 **
     7** Difficulty: 0/5 ** (anyone could do that)
    88
    99Following some renaming/refactoring that occurred in [browser:trunk/src/lol/base/array.h] and [browser:trunk/src/lol/base/string.h], some methods only remain here for backwards compatibility. Look for the string “TODO” in these files:
     
    1818Each of these methods needs to be **removed** and all resulting compilation errors **fixed**. Do **not** perform a blind search/replace, and pay attention to **indentation**.
    1919
    20 == Variadic versions of `min()` and `max()` ==
     20== Task: Variadic versions of `min()` and `max()` ==
    2121
    22 ** Difficulty: 2/5 **
     22** Difficulty: 2/5 ** (understand variadic templates and move operator)
    2323
    2424The prototypes for `min()` and `max()` in [browser:trunk/src/lol/base/functions.h] are defined as follows:
     
    4747Be careful that the code should build with **Visual Studio 2013**, which is actually the real difficulty here.
    4848
    49 == `rand()` for vector types ==
     49== Task: `rand()` for vector types ==
    5050
    51 ** Difficulty: 2/5 **
     51** Difficulty: 2/5 ** (a lot of template code to read)
    5252
    5353We would like to write the following code:
     
    6969
    7070Make sure it works for **all `vec_t<N,T>`** types, not just `vec3` or `vec4`.
     71
     72== Task: matrix inversion that doesn’t suck ==
     73
     74**Difficulty: 3/5** (some maths required)
     75
     76The current implementation of matrix inversion in [browser:trunk/src/lol/math/matrix.h] is the mediocre cofactor technique. It has **factorial complexity** which wasn’t a problem when we only had 4×4 matrices (though it was already slightly slow) but is no longer acceptable.
     77
     78Suggestion:
     79
     80 - rewrite `mat_t::inverse()` but also `mat_t::determinant()` and get rid of `mat_t::cofactor()`
     81 - use Gauss-Jordan elimination in the general case (see [browser:trunk/tools/lolremez/matrix.h] for a simple implementation
     82 - specialise inversion for 2×2, 3×3 and maybe 4×4 matrices (see [http://www.cg.info.hiroshima-cu.ac.jp/~miyazaki/knowledge/teche23.html this page for formulas])
     83
     84Make sure to write **unit tests** for this code!