
Show HN: C++ maths library for graphics and games - polymonster
https://github.com/polymonster/maths
======
polymonster
I wanted to share my c++ maths library have been adding to for quite a long
time now, There are lot of other available maths libraries but I have enjoyed
developing and maintaining this over the years since.

As a graphics programmer it has been a good learning experience to implement
my own maths library from scratch because linear algebra is such an integral
part of my job, I also learned a lot about template programming to implement
the types and also the vector swizzles.

A lot of other available maths libraries provide matrix, quaternion and
vectors.. but not as many provide a vast collection of geometric intersection
and overlap tests as my library does.

Additionally other maths libraries may be SIMD implementations, this library
is all scalar and that is my intention all along. I favour the portability and
simplicity of the scalar implementation.. I do like SIMD for sure but find
that code can be optimised to much greater effect by writing entire algorithms
in SIMD and not relying on the underlying vector / matrix SIMD
implementation.. this is due to often a large number of horizontal operations
may be necessary in certain algorithms.

This may be a bit dated now, but my experience with SIMD vector
implementations on PowerPC were very inefficient because of general use games
/ graphics code often wants to access and set single vector elements and get
them into floats and it would cause load hit stores and massive performance
penalties, so then you require the scalar float in vec type and add all that
additional complexity.

Anyway.. I hope people might find this useful if you are looking for a simple
c++ maths library packed with great features for graphics and games :)

