New extension: <Quaternions> #1930
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
The extension adds Quaternion functionality to GDevelop. This avoids Euler angles by first converting to Quaternions. Issues like gimbal lock and order of rotations can mostly be ignored with quaternions. Any 3d rotations generally need quaternions and in future it will have slerp functionality, allowing interpolated rotations that are different to Euler interpolation. Made by InkedToast
How to use the extension
All functions store values in Struct variables with children W X Y Z. In future the above will also be accessable through expressions. To use effectively convert Euler angles to Quaternion and apply rotations through Quaternion multiplication. Next keep rotations stored as Quaternions and apply by first normalising and then converting back to euler. To reverse a rotation, multiply by the inverse Quaternion.
Enjoy.
Checklist
Example file
QuaternionExample.zip
Extension file
Quaternions.zip
Extension by @MooseMakesGames
You can update the extension on this "Pull Request" by commenting the update command: in the comment field, type
!update, then drag and drop a zip file with your extension file in the commenting field, like how you initially submitted the extension. It should look like this:It can take a few seconds for the file to fully upload and show as the above. Once it is like shown above, click "Comment" and let the bot do the rest!