JOML-CI / JOML

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

Matrix4f.getEulerAnglesYXZ #325

Closed liskar-dev closed 1 year ago

liskar-dev commented 1 year ago

Matrix4f has defined methods getEulerAnglesXYZ getEulerAnglesZYX but for some reason YXZ variant is missing. Is there any specific reason?

I get it indirectly from quaternion via matrix->getNormalizedRotation->getEulerAngles now, but it would be cool to have it directly in Matrix4f.

httpdigest commented 1 year ago

Sure. This method is now implemented in the matrix classes. Usable on the latest 1.10.6-SNAPSHOT build on oss.sonatype.org. Though I am realizing that the convention of "returning the angle around X, Y and Z always in the vector's respective X, Y and Z fields" (regardless of the rotation order) is not useful when wanting to compute proper Euler angles that rotate only around two angles, like XZX, XYX, YXY, etc. I will probably introduce new methods for that convention to not break the existing methods.