Comment by bob1029
2 days ago
I am curious if the author considered use of the built-in numerics library over hand-rolling types like Vector4F.
All of the methods defined here:
https://github.com/Helion-Engine/Helion/blob/20300d89ee4091c...
Are available in the kitchen sink:
https://learn.microsoft.com/en-us/dotnet/api/system.numerics...
Same idea applies to methods like GetProjection, which could be replaced with methods like:
https://learn.microsoft.com/en-us/dotnet/api/system.numerics...
Advantages of using this library are that it is uses intrinsics (SIMD) to accelerate operations. There is a lot of Microsoft money & time that has been invested into these code piles.
I also see the guys from Intel constantly stabbing at all these low-level types to optimize them too. There are optimizations in .NET 10 for processors that aren't even released yet.
I suspect it's part of the fun? A way to really learn something?
There's also another hint:
// THIS FILE WAS AUTO-GENERATED. // CHANGES WILL NOT BE PROPAGATED. // ----------------------------------------------------------------------------
(Of course this could be a result of something having nothing to do with the contents of the file, but maybe the author has to meta library that can generate the types in different languages).
There seems to be fixed-precision variants of the vector types as well which seems to be not available in the .NET framework.
Plus, of course, you can't add your specifics needs to library types (like the fixed precision). They are closed to modification.
I am just guessing, of course.
That being said, it would also make total sense to use the .NET types.
It looks like these types were code-gen from something else.
https://github.com/Helion-Engine/Helion/commit/e6affd9abff14...
Further down in the commit there's a Generators project that has the VectorGenerator class.
> [a diff with] +4620 -1454 [lines]
Someone should learn some CS and then how to make proper commits.
This is pull requests, there are commits
Additionally this is generated code.
Computer science has literally nothing to do with good commit habits.
I posted further down about Bepu Physics v2: https://github.com/bepu/bepuphysics2
It heavily uses numerics and the performance is amazing.
Historically the .NET and XNA vector types have been seriously lacking for real graphics development, and they still don't even provide swizzling. It's likely that this project predates .NET numerics by many years, and anyone who has had a pet project for long enough will learn to avoid becoming too dependent on libraries and platforms that will die out.