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:
parent
9b2ee1dd5d
commit
ef2bcba56a
11 changed files with 65 additions and 69 deletions
|
@ -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))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue