RT-EGG / CsLibraries

The library for me. C# common, mathematics, graphics with OpenGL (C# library OpenTK).
Other
0 stars 0 forks source link

Improve implementation of base of Matrix and Vector #2

Closed RT-EGG closed 2 years ago

RT-EGG commented 3 years ago

Calculation of Matrix and Vector structs uses methods using interface. Converting struct to interface causes boxing with not low cost.

RT-EGG commented 2 years ago

Change calculation from using interface to using generics constrained with interface.

https://stackoverflow.com/questions/3032750/structs-interfaces-and-boxing

RT-EGG commented 2 years ago

Boxing may cause when Vector2(/3/4) constructor received IEnumerable typed argument from Vector calculation class methods or other. Can't use common calculation method to initialize struct...?