8000 Move from Euler angles to Quaternions · Issue #38 · anegostudios/vsapi · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Move from Euler angles to Quaternions #38

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

Open
LubieKakao1212 opened this issue Feb 1, 2025 · 0 comments
Open

Move from Euler angles to Quaternions #38

LubieKakao1212 opened this issue Feb 1, 2025 · 0 comments

Comments

@LubieKakao1212
Copy link

I would like to suggest moving away from using euler angles which are numerically unstable, to quaternions which are more stable and more consistent in interpolation, regarding that I have these suggestions:

  • Add a quaternion rotation property to EntityPos:
    • Mark Roll as deprecated
    • (This may be a breaking change) Make it so Yaw always rotates around global Y, and Pitch rotates around local Left (or Right), this can be implemented via introduction of new Yaw and Pitch and marking the old ones as deprecated
    • Add a bool UseEuler field to EntityPos which would default to true
    • Add Quaternion rotation getter to EntityPos which depending of the state of UseEuler would either use local quaternion value or calculate one from euler angles (preferably with caching)
    • Make rendering (and probably also other places which I don't know about) use the Quaternion field instead of euler angles directly
    • Split Interpolation behavior into Quaternion interpolation behavior and Euler interpolation behavior
  • Add Typesafe Quaternion api i.e. Quaternion class analogus to Vec3d or Vec3f or any other vector
    • Also do the same thing for matrices (I don't know why they use arrays instead of proper classes)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant
0