1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-08-06 17:41:04 +00:00

Document & extend testing for rotation conventions (#16200)

* Document Luanti rotation conventions
* Add test for setPitchYawRollRad (entity) rotation conventions
* Test and document that `vector.rotate` uses (extrinsic) Z-X-Y rotation order
This commit is contained in:
Lars Müller 2025-07-13 17:11:12 +02:00 committed by GitHub
parent 33940021a1
commit 23bf50a07c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 123 additions and 38 deletions

View file

@ -167,8 +167,9 @@ public:
vector3d<T> getTranslation() const;
//! Make a rotation matrix from Euler angles. The 4th row and column are unmodified.
//! NOTE: Rotation order is ZYX. This means that vectors are
//! first rotated around the X, then the Y, and finally the Z axis.
//! NOTE: Rotation order is (extrinsic) X-Y-Z.
//! This means that vectors are first rotated around the X,
//! then the (unrotated) Y, and finally the (unrotated) Z axis.
//! NOTE: The rotation is done as per the right-hand rule.
//! See test_irr_matrix4.cpp if you're still unsure about the conventions used here.
inline CMatrix4<T> &setRotationRadians(const vector3d<T> &rotation);