Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Quat instead of Basis when sending rotations over the network. #151

Closed
drwhut opened this issue Dec 1, 2022 · 0 comments
Closed

Use Quat instead of Basis when sending rotations over the network. #151

drwhut opened this issue Dec 1, 2022 · 0 comments
Assignees
Labels
feature New feature or request
Milestone

Comments

@drwhut
Copy link
Owner

drwhut commented Dec 1, 2022

Is your feature request related to a problem? Please describe.
When the physics state of pieces are sent from the server to the client, and when the client wants to set the rotation of a piece, Basis is used. While it does work in representing rotation, it is not optimal in terms of memory usage, calculation speed, and floating-point errors.

Describe the solution you'd like
Using Quat instead uses 4 floats rather than 9, is more resistant to floating-point inaccuracies, and most importantly, slerp is much faster, which is very useful when the piece is being hovered.

Describe alternatives you've considered
Sticking with using Basis, which works, but as mentioned, it is not optimal.

Additional context
This optimisation was spotted in #133.

@drwhut drwhut added the feature New feature or request label Dec 1, 2022
@drwhut drwhut added this to the v0.1.0 milestone Dec 2, 2022
@drwhut drwhut self-assigned this Dec 3, 2022
@drwhut drwhut closed this as completed in d3b8276 Dec 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant