GDevelop-extensions icon indicating copy to clipboard operation
GDevelop-extensions copied to clipboard

New extension: <Quaternions>

Open github-actions[bot] opened this issue 1 month ago • 1 comments

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

  • Convert Euler ZYX to Quaternion WXYZ
  • Convert Quaternion to Euler (The numbers may look different like a euler 100 100 100 will become -80 80 -80 after converting and then converting back as quaternions have multiple solutions, but the angle will still be the same)
  • Multiply Quaternion1 by Quaternion2
  • Quaternion Inverse
  • Quaternion normalisation (to make length 1)

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

  • [x] I've followed all of the best practices.
  • [x] I confirm that this extension can be integrated to this GitHub repository, distributed and MIT licensed.
  • [x] I am aware that the extension may be updated by anyone, and do not need my explicit consent to do so.

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:

!update [MyExtension.zip](https://github.com/GDevelopApp/GDevelop-extensions/files/12709661/MyExtension.zip)

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!

github-actions[bot] avatar Nov 30 '25 07:11 github-actions[bot]

Thank you for submitting an extension.

Extensions from the repository aim to be as easy to understand as possible. They are usually high level to avoid to require too much mathematics or programming knowledge. For instance, it can be:

  • helper actions, Advanced 3D Features extension allow "Local translation and rotation"
  • movement behaviors, some work has be done on a plane behavior that is not yet released

I understand that power-users need to work with quaternions to build their own extensions, but I guess they will use the implementation from Three.js.

What do you think about submitting a link to the community list to taste the water?

  • https://github.com/GDevelopApp/GDevelop-community-list?tab=readme-ov-file#-how-to-contribute

D8H avatar Dec 07 '25 16:12 D8H