Skip to content

gold-meridian/mathematics

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 

Repository files navigation

mathematics


General-purpose math utilities for .NET, mostly oriented around game development.

GoldMeridian.Mathematics


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/4 operators;
    • parity with Vector2/3/4 public properties:
      • AllBitsSet (TODO),
      • One (also True for bools),
      • Zero (also False for bools),
      • NegativeZero,
      • E,
      • NaN,
      • NegativeInfinity,
      • Pi,
      • PositiveInfinity,
      • Tau,
      • UnitX (also TrueX for bools),
      • UnitY (also TrueY for bools),
      • UnitZ (also TrueZ for bools),
      • UnitW (also TrueW for bools);
    • parity with Vector2/3/4 public methods (TODO).
  • Matrices:

    • TODO (after vectors).

GoldMeridian.Mathematics.Iwakura

"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.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages