IOMath is a fast header-only cross-platform math library. It's architecture is similar to GLM.
Example:
#include <IOMath/Vectors.hpp>
#include <IOMath/Matrices.hpp>
using namespace IOMath;
constexpr unsigned SCREEN_WIDTH = 1920;
constexpr unsigned SCREEN_HEIGHT = 1080;
int main(int, char**)
{
Matrix4 modelMatrix = Matrix4::Identity();
Translate(modelMatrix, Vector3(1.0f, 2.0f, 3.0f));
Scale(modelMatrix, Vector3(3.0f, 3.0f, 1.5f));
Rotate(modelMatrix, Vector3(1.0f, 0.0f, 0.0f), Radians(45.0f));
Matrix4 viewMatrix = LookAtMatrix(Vector3(0.0f, 0.0f, 0.0f), Vector3(0.0f, 0.0f, -1.0f), Vector3(0.0f, 1.0f, 0.0f));
Matrix4 projectionMatrix = PerspectiveMatrix(90.0f, static_cast<float>(SCREEN_WIDTH) / SCREEN_HEIGHT, 0.1f, 1000.0f);
Vector3 vertexPosition = Vector3(0.5f, -0.5f, 0.5f);
Vector4 spacePosition = projectionMatrix * viewMatrix * modelMatrix * Vector4(vertexPosition, 0.0f);
return 0;
}
To run test type followind in the command line:
cd tests/
cmake . -Wno-dev && cmake --build .
ctest --output-on-failure
Boost (only for testing)
IOMath is licensed under the MIT license.