Closed Syncaidius closed 10 months ago
Any reason to not already port to .net7 then? Its unlikely this project gets released before .net7 anway?
@IceReaper The main reason is stability. Previews tend to have bugs or unfinished features. Although preview 7 is the last one before release in November, other dependencies, such as Silk.NET will also need time to catch up and support it.
Since this would be a quality-of-life change, it makes more sense to prioritize critical systems such as rendering, audio and UI for now. But, if anything comes up along the way that must have generic math, then this will definitely get pushed up in priority.
After looking into this further, generic math will not work well for Molten's vector types, as it would still need at least one generic type per vector size (Vector2, 3, and 4) and a separate set for integer and floating-point vectors, which still adds up to a not-so-small amount of types.
The lack of struct inheritance also means that, unless everyone is expected to type something like Vector2F<float>
or Vector2I<int>
everywhere, it would also need non-generic versions of each vector size.
For now at least, it seems better to stick with template-generated vector types.
The first step towards generic math usage has been made by implementing IVector on all vector types. Also includes ISignedVector
and IUnsignedVector
.
Once .NET 7 release around November, look into the use of generic math operators to clean up math type generation. Currently it uses some overly-complex text-template (.tt) files to output a large amount of codebase for vector and quaternion types.
See for details: https://devblogs.microsoft.com/dotnet/dotnet-7-generic-math/