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

Move Luanti rotation matrix helpers to own header

This commit is contained in:
Lars Mueller 2025-05-10 20:57:13 +02:00
parent 9b2ee1dd5d
commit ef2bcba56a
11 changed files with 65 additions and 69 deletions

View file

@ -8,7 +8,7 @@
#include "object_properties.h"
#include "serveractiveobject.h"
#include <quaternion.h>
#include "util/numeric.h"
#include "util/rotation_matrix.h"
class UnitSAO : public ServerActiveObject
{
@ -26,7 +26,7 @@ public:
const v3f getTotalRotation() const {
// This replicates what happens clientside serverside
core::matrix4 rot;
setPitchYawRoll(rot, -m_rotation);
setPitchYawRollRad(rot, -m_rotation * core::DEGTORAD);
v3f res;
// First rotate by m_rotation, then rotate by the automatic rotate yaw
(core::quaternion(v3f(0, -m_rotation_add_yaw * core::DEGTORAD, 0))