Skip to content

Commit 666f8de

Browse files
committed
Merge branch 'rotationesmtool' into 'master'
Print cell reference rotation and destination rotation in esmtool (#8874) Closes #8874 See merge request OpenMW/openmw!5060
2 parents 87da40e + f537151 commit 666f8de

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

apps/esmtool/esmtool.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111

1212
#include <boost/program_options.hpp>
1313

14+
#include <osg/Math>
15+
1416
#include <components/esm/format.hpp>
1517
#include <components/esm3/esmreader.hpp>
1618
#include <components/esm3/esmwriter.hpp>
@@ -251,6 +253,9 @@ namespace
251253
std::cout << " ID: " << ref.mRefID << '\n';
252254
std::cout << " Position: (" << ref.mPos.pos[0] << ", " << ref.mPos.pos[1] << ", " << ref.mPos.pos[2]
253255
<< ")\n";
256+
std::cout << " Rotation: (" << osg::RadiansToDegrees(ref.mPos.rot[0]) << ", "
257+
<< osg::RadiansToDegrees(ref.mPos.rot[1]) << ", " << osg::RadiansToDegrees(ref.mPos.rot[2])
258+
<< ")\n";
254259
if (ref.mScale != 1.f)
255260
std::cout << " Scale: " << ref.mScale << '\n';
256261
if (!ref.mOwner.empty())
@@ -277,6 +282,9 @@ namespace
277282
{
278283
std::cout << " Destination position: (" << ref.mDoorDest.pos[0] << ", " << ref.mDoorDest.pos[1]
279284
<< ", " << ref.mDoorDest.pos[2] << ")\n";
285+
std::cout << " Destination rotation: (" << osg::RadiansToDegrees(ref.mDoorDest.rot[0]) << ", "
286+
<< osg::RadiansToDegrees(ref.mDoorDest.rot[1]) << ", "
287+
<< osg::RadiansToDegrees(ref.mDoorDest.rot[2]) << ")\n";
280288
if (!ref.mDestCell.empty())
281289
std::cout << " Destination cell: " << ref.mDestCell << '\n';
282290
}

apps/esmtool/record.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
#include <numeric>
77
#include <sstream>
88

9+
#include <osg/Math>
10+
911
#include <components/esm3/cellstate.hpp>
1012
#include <components/esm3/esmreader.hpp>
1113
#include <components/misc/strings/conversion.hpp>
@@ -176,8 +178,9 @@ namespace
176178
{
177179
std::cout << std::format(" Destination Position: ({:12.3f},{:12.3f},{:12.3f})\n", dest.mPos.pos[0],
178180
dest.mPos.pos[1], dest.mPos.pos[2]);
179-
std::cout << std::format(" Destination Rotation: ({:9.6f},{:9.6f},{:9.6f})\n", dest.mPos.rot[0],
180-
dest.mPos.rot[1], dest.mPos.rot[2]);
181+
std::cout << std::format(" Destination Rotation: ({:9.6f},{:9.6f},{:9.6f})\n",
182+
osg::RadiansToDegrees(dest.mPos.rot[0]), osg::RadiansToDegrees(dest.mPos.rot[1]),
183+
osg::RadiansToDegrees(dest.mPos.rot[2]));
181184
if (!dest.mCellName.empty())
182185
std::cout << " Destination Cell: " << dest.mCellName << std::endl;
183186
}
@@ -1308,7 +1311,8 @@ namespace EsmTool
13081311
std::cout << " Hour:" << mData.mCellState.mLastRespawn.mHour << std::endl;
13091312
if (mData.mCellState.mHasFogOfWar)
13101313
{
1311-
std::cout << " North Marker Angle: " << mData.mFogState.mNorthMarkerAngle << std::endl;
1314+
std::cout << " North Marker Angle: " << osg::RadiansToDegrees(mData.mFogState.mNorthMarkerAngle)
1315+
<< std::endl;
13121316
std::cout << " Bounds:" << std::endl;
13131317
std::cout << " Min X: " << mData.mFogState.mBounds.mMinX << std::endl;
13141318
std::cout << " Min Y: " << mData.mFogState.mBounds.mMinY << std::endl;

0 commit comments

Comments
 (0)