Boost QVM is a generic library for working with **q**uaternions, **v**ectors and **m**atrices of static size with the emphasis on 2, 3 and 4-dimensional operations needed in graphics, video games and simulation applications.

In graphics and simulation applications, there is a need for a library that makes it easy to perform 2D and 3D transformations efficiently. C++ makes it possible to define vector and matrix types and to overload various operators to implement the standard algebraic operations. Because this is a relatively straightforward process, there are many such libraries in existence, each with its own types and operator overrloads. Such libraries are typically part of a higher level system, such as a graphics engine or a 3D modeling API. As a result, it is typical for programmers to have to integrate and to translate between several different quaternion, vector and matrix types that come with the various APIs they use.

On the other hand, performance considerations often lead to matrix and vector types becoming coupled with a particular platform, or to (over time) acquire various *#ifdefs* needed to enable optimizations through platform-specific compiler features that control the physical format or layout of their elements. However, such optimizations may interfere with ease of use and portability; for example on some platforms requiring 16-byte alignment for matrix types makes them incompatible with standard containers.

Boost QVM solves both of these issues by decoupling the standard algebraic operations from the types they operate on -- without compromising type safety.

- Emphasis on 2, 3 and 4-dimensional operations (including quaternions and zero-overhead
*Swizzling*) as needed in graphics and simulation applications. - Zero-overhead view proxies that can be used to access an object with quaternion, vector or matrix semantics through a read-only or mutable reference of a different type. For example,
*col<C>(m)*binds the*C*-th column of a matrix*m*as a mutable vector type without the overhead of a temporary. - Integration of many user-defined or 3rd-party quaternion, vector or matrix types into a coherent type-safe system. This enables the user to build algebraic expressions using objects of diverse types that would otherwise be incompatible.
- When users need to implement platform-specific or even project-specific optimizations in a given subsystem, Boost QVM makes it simple to define custom new types that automatically aquire the full set of algebraic operations so they can interface seamlessly with the rest of the program. At the same time, the user can define a limited number of overloads for the new types as needed to implement specific optimizations.

- Tutorial
- Reference
- Type traits
- Quaternion, vector and matrix types
- Accessing quaternion elements
- Accessing vector elements
- Accessing vector elements by swizzling
- Accessing matrix elements
- Quaternion operations
- Vector operations
- Matrix operations
- Quaternion-vector operations
- Vector-matrix operations
- Matrix-to-matrix view proxies
- Vector-to-matrix view proxies
- Matrix-to-vector view proxies
- Generic programming utilities
- Exception types
- Macros and configuration
- Namespace boost::qvm::sfinae

- Synopsis
- Code generator
- Known quirks and issues
- Questions and answers
- Indexes

QVM is part of Boost. Please see git submodule at https://github.com/boostorg/qvm.

For support, please use the Boost Developers Mailing List.