Skip to content

Commit cc5cc31

Browse files
committed
SkySphere: fix north angle
1 parent dd94c5f commit cc5cc31

1 file changed

Lines changed: 3 additions & 8 deletions

File tree

src/OpenCOVER/plugins/general/SkySphere/SkySphere.cpp

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@
5252
#include <string>
5353
#include "cover/coVRConfig.h"
5454
#include <PluginUtil/PluginMessageTypes.h>
55-
#include <../../../../3rdparty/easyexif/exif.h>
5655
#include <filesystem>
5756

5857
#include "VrmlNodeSkySphere.h"
@@ -229,14 +228,10 @@ void parseExifData(const std::filesystem::path &path, double &longitude, double
229228
auto gimbalYawIt = xmpData.findKey(Exiv2::XmpKey("Xmp.drone-dji.GimbalYawDegree"));
230229
auto flightYawIt = xmpData.findKey(Exiv2::XmpKey("Xmp.drone-dji.FlightYawDegree"));
231230

232-
double yaw = 0.0;
233-
234231
if (gimbalYawIt != xmpData.end())
235-
yaw += xmpData["Xmp.drone-dji.GimbalYawDegree"].toFloat();
232+
trueNorth = xmpData["Xmp.drone-dji.GimbalYawDegree"].toFloat() + 90;
236233
if (flightYawIt != xmpData.end())
237-
yaw += xmpData["Xmp.drone-dji.FlightYawDegree"].toFloat();
238-
239-
trueNorth = yaw + 180.0;
234+
trueNorth = xmpData["Xmp.drone-dji.FlightYawDegree"].toFloat() + 90;
240235
}
241236
}
242237

@@ -427,7 +422,7 @@ bool SkySphere::update()
427422
const osg::Matrix &m = cover->getObjectsXform()->getMatrix();
428423

429424
skyRootNode->setMatrix(
430-
osg::Matrix::scale(scale, scale, scale) * osg::Matrix::rotate(osg::DegreesToRadians(northAngle), osg::Vec3(0, 0, 1)) * osg::Matrix::rotate(m.getRotate())
425+
osg::Matrix::scale(scale, scale, scale) * osg::Matrix::rotate(osg::DegreesToRadians(-northAngle), osg::Vec3(0, 0, 1)) * osg::Matrix::rotate(m.getRotate())
431426
* osg::Matrix::translate(cover->getViewerMat().getTrans()));
432427
return false; // don't request that scene be re-rendered
433428
}

0 commit comments

Comments
 (0)