Vector Math #3966
luanpotter
started this conversation in
V2 Ideas
Vector Math
#3966
Replies: 3 comments 3 replies
|
The issue I found was that basically: records can't be mutable. That alone makes some common gameloop operations up to 10 times slower |
3 replies
|
We can explore the usage of a extension type based solution where extension types would wrap optimized |
0 replies
|
Now I've tested lot's of alternatives, and all sensible alternatives seem to point to moving away from the vector_math library. So I think we should move Structure
Efficiency (AOT, ns per component per operation, measured)
Ergonomics
Whatcha think? |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
We have explored in the past replacing
Vector2and others from the vector_math package with a records based approach. The issue right now is that allocating Vector2's can be expensive within the game loop, and that forces people to write very non-ergonomic vector math code, for example, instead of being able to cleanly write something like:you would need consider saving these to fields and updating them:
We have explored using records in the past as they require no allocation and are treated like two floats in memory, but I recall @renancaraujo has found some issues. I think it is time we revisit those issues to see if they still exist and explore other possibilities before committing to Vector2 for V2.
All reactions