Open provencher opened 1 year ago
I'm really torn on this one, since it seems like, well, unity itself is torn between their old math structs vs the new ones. I don't know what I should do!
Well with IL2CPP the new math library is pretty much equivalent to the old one, but some of the older components still require Vector3s and Quaternions, instead of float3 and quaternions, but you can easily cast between them.
Also, if you work with native arrays arrays of floatxs from the new library (starting with unity 2022.1), you can reinterpret cast between them and the vector equivalents at no cost. Burst works on static functions too now, so you can even make the whole thing burst optimized.
See here on burst support! https://docs.unity3d.com/Packages/com.unity.burst@1.6/manual/docs/CSharpLanguageSupport_Types.html
In any case, this is just a feature request, I've found gains of up to 50% using burst optimized math over the traditional approach.
Just came across this repo, and it looks fantastic! I've been in the process of more heavily investing in Burst optimizing static functions, and this package looks largely static to begin with.
Any chance it could leverage mathematics utilities and structs instead of the ones in the old math library, so that they could automatically be optimized using the compiler optimizations supported by the new math library?