|
utility 2026.1.9
A comprehensive C++ utilities library tailored for the development of modern desktop and extended reality (XR) applications.
|
This document describes each module's responsibilities, invariants, and conventions. It is intended for adopters who need to integrate the library into their own code.
Public headers live under headers/utility/<module>/ and are included as utility/<module>/<header>.hpp. Implementations live under sources/ in the same module structure.
utility::graphic types that are UI-facing (for example ray intersection helpers) may adopt a Y-down convention. Check the individual header for the intended convention before assuming a default.utility/math/trigonometric.hpp.float/double). Matrices and vectors store components in column-major order for columns/rows of 2..4, and Matrix/Vector provide both direct component access and GLM interop.==.Thread-safety is opt-in per type. Unless a header explicitly documents thread-safety, instances are not safe to share across threads without external synchronization. Specifically:
utility::Cache is declared thread-safe and is intended for concurrent access. (If you observe otherwise, report it: it must be synchronized.)utility::logging is currently not thread-safe; route logs from a single thread or add your own mutex.utility::sound::AudioManager uses a runtime control flag that must be treated as single-threaded access.utility::sound::DecoderRegistry.Vectors, matrices, quaternions, and scalar helpers backed by GLM.
Vector, Matrix, Quaternion, Aabb (3D axis-aligned bounding box, with AabbF/AabbD aliases), and free functions for perspective, look-at, rotation, and integer/trigonometric helpers.Rendering-friendly data types.
Color, Pose, Position, Scale, Orientation, Vertex, Mesh, Material, Shader, Texture, View, Ray, and text/font types (Font, FontSized, CodePoints, Text).Renderable::getModelMatrix() and the transform.hpp helpers (poseToMatrix, modelMatrix) convert a pose (and an optional scale) into the glm::mat4 model matrix consumed by per-instance rendering.Material carries renderer-agnostic alpha semantics through AlphaMode::Opaque (default), AlphaMode::Mask (alpha-tested against getAlphaCutoff(), default 0.5) and AlphaMode::Blend, so consumers pick an opaque or an alpha pipeline variant without inferring intent from texture types or shader names. TextMaterial is Blend. Mask is data only until a fragment shader implements discard; renderers should treat it as Blend in the meantime.utility::RessourceProvider rather than constructed directly.Event models for input and XR interactions.
Event, MouseMotionEvent, MouseButtonEvent, keyboard and text input events, and XR hand events.Factory that produces either a base Event or a strongly typed instance.Asset and file helpers for desktop and Android.
File is an in-memory read/write buffer with a seek cursor. It stores content as a byte string; prefer it for in-memory asset manipulation.Logger interfaces and implementations.
Audio buffers, sources, and decoders.
AudioBuffer, AudioSource, AudioManager, and decoders for WAV and MP3 registered through DecoderRegistry.