The Aurora Mathematics Library is a collection of math related types and functions, and serves as one of the core libraries of the Aurora Game Engine.
- Vectors: This library contains the types
vec2
,vec3
,vec4
,ivec2
,ivec3
, andivec4
, each type contains a number of functionalities including but not limited to swizzle properties, intertype conversions, for the floating point vectors they also contain a number of interpolation methods - Matrices: This library includes base types for matrices starting with
matrix<T, int, int>
from which any size and type of matrix can be defined, the standard matrix sizes 'NxM' through 2-4 have also been defined in the format ofmatrixNxM<T>
, concrete matrix typesmat2
,mat3
, andmat4
have also been defined deriving frommatrixSxS<float>
containing properties fordeterminant
, andtrace
as well as methods foradjugating
,inverting
,transposing
.mat3
contains a number of methods for creating 2D transformation matrices, andmat4
contains the same for 3D transformations. - Colors: This library contains 3 color structs that can be used interchangeably
col
(a floating point RGBA representation),col32
(an integer RGBA representation backed byuint8_t
values), and anhsv
(a floating point HSVA representation) - Angles: This library contains an angle struct that defines trignometric functions, as well as angle interpolation and angle wrapping, it represents an angle without a specific 'unit type', and can be used as either degrees or radians, it also defines literal suffixes 'deg' for creating an angle as a representation of the specified degrees, and 'rad' for doing the same as a representation of the specified radians. (NOTE: these suffixes do not use the 'standard' '_' prefix)
- Temperature: This library also contains a temperature struct that defines a 'unitless' temperature representation, it can be created and accessed as 'Celsius', 'Fahrenheit', or as 'Kelvin', it also defines the literal suffixes 'cel', 'fah', and 'kel'. (NOTE: these suffixes do not use the 'standard' '_' prefix)
- Math: The real core of this library, is the 'math' file, which contains a number of methods ranging from
interpolation
totrigonometry
and much more, the trig functions in this file operate with and return (when returning angles) degrees, and not radians. The math file also defines a methods 'precision' which is used to calculate the 'epsilon' properties value, which in turn is used by theapproximately
method, to compare the absolute difference between 2 floating-point values against a threshold (calculated as 1e-precision), if the precision is set to less than 0, then theapproximately
method will behave as an 'exact equality' check.
- Flexibility: From allowing users to work with angles and temperatures in the units they prefer, to the ability to customize the precision of 'approximate equality', this library aims to provide as flexible a usage as possible.
- Ease of Use: With a user-friendly API, and a 'total include' file (useable by including '<Aurora/mathematics.h>), working with the functions and types in this library is as quick and simple as possible.
- Efficiency: This library is built to be as optimized as possible (albiet at this time that is still a work in progress) making this library suitable for everything math related from simple equations to complex 3D rendering applications and simulations.
This library contains no platform specific calls and is suitable for use by any and all platforms
Follow these steps to quickly integrate the Aurora Mathematics Library as a static library into your project:
Download the latest release of the Aurora Mathematics Library from the Releases page.
Extract the downloaded files and locate the static library file (e.g., Aurora.Mathematics.a
on Unix-like systems or Aurora.Mathematics.lib
on Windows). Add the library to your project and ensure it is correctly linked during the build process.
Note: that at this time the only currently available 'compiled' version of the library is for Windows.
Include the necessary headers in your C++ files where you intend to use the Aurora Mathematics Library features:
#include <Aurora/Mathematics/vec2.h>
#include <Aurora/Mathematics/mat2.h>
// Include other headers as needed
or to include the entire library
#include <Aurora/mathematics.h>
// Include other headers as needed
You can now start using the library in your C++ project. For example:
// Example using vectors
Aurora::Mathematics::vec3 myVector(1.0f, 2.0f, 3.0f);
float length = myVector.length();
For more detailed information on the available types and functions, refer to the libraries documentation. Note: While this library is still under construction there is no currently available documentation page.
That's it! You're now ready to leverage the power of the Aurora Mathematics Library in your project. If you encounter any issues or have questions, feel free to open an open an issue.
Document the changes and improvements in each release. Link to the Releases page for more details.
This project is licensed under the MIT License.
This library requires only the standard C++ libraries, and has no third party dependencies.