|
Move Vectormath main
C++20 game and graphics mathematics
|
move-vectormath is Move's C++20 game and graphics math library. The current API lives in mv::math and provides arithmetic vectors, invariant-bearing semantic values, transforms, matrices, geometry, spatial queries, culling, and explicit graphics-convention helpers.
The generated API reference is published by version: use the development documentation for main, or the documentation index to select a release tag.
Include the full public surface:
or focused capability headers such as:
Example:
Fallible construction is deliberate: normalized directions, normals, finite geometry, singular inverses, projective homogeneous division, and invalid camera bases do not silently manufacture fallback values.
+X is right, +Y is up, and +Z is the conventional forward axis.value * matrix.Compose(first, second) applies first, then second.Radians<T> or Degrees<T> rather than untyped scalars.Point3, Direction3, and Normal3 are different semantic values.See CONVENTIONS.md and the organized API-v2 design archive.
The canonical target for new consumers is mv::math:
The target publishes the C++20 requirement, public include directory, and the pinned RTM dependency. FetchContent and CPM can add the repository in the same way before linking mv::math.
The repository owns a first-class header-only XMake target:
The upstream project pins the official rtm v2.3.1 package and installs the complete public include tree. A package repository can delegate installation to this project and expose it through add_requires("move-vectormath").
Validate the XMake consumption surface with:
The force_scalar XMake option publishes MV_MATH_FORCE_SCALAR=1 when a portable scalar build is required.
An opt-in C++20 named module exports the same API:
Configure it with --build_modules=y. XMake compiles the BMI locally for the active compiler and flags; installation publishes the module source and metadata, never a nonportable precompiled BMI. The headers remain the canonical implementation and an equal public consumption surface.
The named module is continuously verified with Clang and MSVC and locally verified with GCC 16. GCC 14 remains supported through headers, but its experimental named-module implementation is not part of the module support contract.
The CMake suite exercises GCC, Clang, AppleClang, and MSVC; scalar and RTM backends; sanitizers; generated-code fixtures; shader transfer layouts; and a downstream consumer. XMake has independent RTM and forced-scalar header consumer tests plus direct and downstream named-module consumers on the supported module compilers. Runtime benchmarks live in the separate vectormathbench repository and are diagnostic rather than noisy hosted-runner regression gates.
This repository is licensed under the MIT license. See LICENSE.md.