A lightweight header-only math library for Starlet projects.
- Basic vector types:
Vec2,Vec3,Vec4 Transformstruct for position, rotation, scaleMat44x4 matrix with:- Identity, transpose, inverse
- Translation, rotation, scaling
lookAtandperspectivehelpers- Composition with
Transform
- Constants and helpers:
pi,radians(),degrees() - Starlet Project Constants
- C++20 or later
- One of the following Build Systems,
- CMake 3.20+
- Meson 1.1+
include(FetchContent)
FetchContent_Declare(starlet_math
GIT_REPOSITORY https://github.com/starlet-engine/math.git
GIT_TAG main
)
FetchContent_MakeAvailable(starlet_math)
target_link_libraries(app_name PRIVATE starlet_math)Note: Meson does not fetch dependencies automatically. Add the
starlet_math.wrapfile to your project'ssubprojectsdirectory.
In your meson.build:
starlet_math = subproject('starlet_math')
starlet_math_dep = starlet_math.get_variable('starlet_math_dep')
executable('app_name', 'main.cpp', dependencies: starlet_math_dep)# 1. Clone starlet-math
git clone https://github.com/starlet-engine/math.git
cd starlet-mathcmake -B build -DBUILD_TESTS=ON
cmake --build build
ctest --test-dir buildmeson setup build -Dbuild_tests=true
meson compile -C build
meson test -C buildMIT License — see LICENSE for details.