From deba3b5e728fea26825426ea6f61425f167d944f Mon Sep 17 00:00:00 2001 From: lzwdgc Date: Wed, 9 Dec 2020 18:48:15 +0300 Subject: [PATCH] [mmo_extractor] Improve yaw calculations. Remove hardcoded angle. Fix atan2 arguments to correctly calculate yaw. --- src/mmo_extractor/mmo_extractor.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mmo_extractor/mmo_extractor.cpp b/src/mmo_extractor/mmo_extractor.cpp index 780cd44..8a1ab37 100644 --- a/src/mmo_extractor/mmo_extractor.cpp +++ b/src/mmo_extractor/mmo_extractor.cpp @@ -132,9 +132,9 @@ void write_mmo(Storage *storage, const mmo_storage &s, const std::string &mapnam auto calc_yaw = [](auto &v) { - auto yaw = atan2(v[1].x / v[2].z, v[0].x / v[2].z); + auto yaw = atan2(-v[0].y, -v[0].x); yaw = RAD2GRAD(yaw); - return -(yaw - 90); + return yaw; }; int inserted = 0;