Open Witek902 opened 9 years ago
When stumbling across Math code in nfCommon, I noticed, that entire Math module still has its separate namespace (NFE::Math), even though it is a part of nfCommon library. IMO we should do something about it. Either:
Personally, I think that second option would be easier if we don't want to modify entire project's code. Math is separated from nfCommon (no module includes nfCommon.hpp), it can be compiled separately. Additionally, using it in other projects, if any, would be easier. Question is, do we want another library to link against.
Additionally to this issue, please make sure, that Math will be compileable under Linux.
[x] Write non-SSE versions of all the functions (FPU only).
[x] Some of the functions could be turned into operators and methods. For example global function
Matrix MatrixInverse(const Matrix& m)
should be converted to methods:void Matrix::Invert()
andMatrix Matrix::Inverted() const
.[x] Convert Quaternion into a class and get rid of global functions like
QuaternionMultiply
- they should be methods.[ ] Add missing functions:
[ ] Write fast SSE and AVX versions of some Intersection functions, e.g. IntersectFrustumSpheres, IntersectFrustumFrustums, IntersectFrustumBoxes, etc. Will be useful for fast frustum culling.
[x] Write math operators for Float2, Float2 and Float4
[ ] Geometry
[ ] Algebra
Split this task into multiple if needed.
Remember to write unit tests.