JOML-CI / JOML

A Java math library for OpenGL rendering calculations
MIT License
728 stars 104 forks source link

Incorrect Quaterniond .rotationX() function behaviour #355

Open Povstalec opened 2 months ago

Povstalec commented 2 months ago

The Quaterniond class implementation of rotationX() is different from the Quaternionf class, resulting in behaviour not consistent with how quaternions rotated around the X-axis should behave.

The correct code in Quaternionf => 0 rotation around X-axis creates a (0, 0, 0, 1) quaternion: https://github.com/JOML-CI/JOML/blob/5886cdfcabf6225780ff39784bb90a48f9e14b7c/src/main/java/org/joml/Quaternionf.java#L622-L626

Incorrect code in Quaterniond => 0 rotation around X-axis creates a (0, 0, 1, 0) quaternion: https://github.com/JOML-CI/JOML/blob/5886cdfcabf6225780ff39784bb90a48f9e14b7c/src/main/java/org/joml/Quaterniond.java#L2461-L2465