General-purpose math utilities for .NET, mostly oriented around game development.
Contains primitive math types. Vectors and matrices are source-generated to ensure accuracy and to speed up development.
-
Vectors:
- relevant vector types:
-
sbyte, -
byte, -
short, -
ushort, -
int, -
uint, -
long, -
ulong, -
float, -
double, -
bool;
-
- 1-4 lanes:
- automatic conversion between scalar and 1-lane types,
- automatic conversion between applicable SIMD intrinsic vectors,
- padding to align to closest SIMD intrinsic size;
- swizzling (mirrors HLSL):
- getters for all possible combinations,
- setters for combinations without repeat fields;
- constructors (mirrors HLSL):
- broadcasting (scalar -> all lanes),
- mixing different dimensions (e.g.
float4(float x, float2 yz, float w),float4(float3 xyz, float w));
- parity with
Vector2/3/4operators; - parity with
Vector2/3/4public properties:-
AllBitsSet(TODO), -
One(alsoTrueforbools), -
Zero(alsoFalseforbools), -
NegativeZero, -
E, -
NaN, -
NegativeInfinity, -
Pi, -
PositiveInfinity, -
Tau, -
UnitX(alsoTrueXforbools), -
UnitY(alsoTrueYforbools), -
UnitZ(alsoTrueZforbools), -
UnitW(alsoTrueWforbools);
-
- parity with
Vector2/3/4public methods (TODO).
- relevant vector types:
-
Matrices:
- TODO (after vectors).
"Lain Iwakura" and it has lanes... get it?
Lane-agnostic math APIs with a source generator that generates overloads for methods for all viable types. Supports SIMD-width implementations and is designed to closely mirror the .NET SIMD intrinsic APIs to ensure all possible functionality.
Allows you to easily map high-level math functions (think linear interpolation, Bézier curves, anything of that nature) to multiple lanes in parallel without concern for the lane implementations. Concretely-typed overloads (float, Vector2, float2, etc.) will be automatically generated by the source generator for ease-of-use.
TODO, porting from DAYBREAK.