MathFu
An open source project by
FPL.
|
MathFu is a C++ math library developed primarily for games focused on simplicity and efficiency.
It provides a suite of vector, matrix and quaternion classes to perform basic geometry suitable for game developers. This functionality can be used to construct geometry for graphics libraries like OpenGL or perform calculations for animation or physics systems.
MathFu is written in C++, you are expected to be experienced in C++ programming. MathFu should not be your first C++ programming project! You should be comfortable with compiling, linking, and debugging.
This guide provides an overview of the MathFu API, it does not cover every aspect of functionality provided by the library. The entire API is documented by the API reference. In addition, the unit tests (under mathfu/unit_tests
) provide example usage of each class and function in the library.
The core functionality of MathFu is provided by the following classes:
Each class is described in the following sections of the guide:
In addition, MathFu provides a suite of general math functions and method that make it easier to handle the special requirements of SIMD data types described in the Utilities section.
MathFu is optimized using SIMD instructions (including NEON for ARM and SSE for x86 architectures). SIMD optimization is enabled by default based upon the target platform and compiler options used to build a project. In addition, MathFu provides compile time options to modify code generation, see Build Configurations for more details.
MathFu's SIMD implementation uses vectorial as an abstraction layer for common SIMD instructions and data types. To support additional architectures, contributors can add support for new SIMD instructions and data types to the vectorial project and then modify the code in mathfu/utilities.h to define the macro MATHFU_COMPILE_WITH_SIMD
for the new architecture.