1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-07-03 09:11:39 +00:00

Merge branch 'esscamera' into 'master'

essimporter: Recover player's pitch from PCDT (bug #6818)

Closes #6818

See merge request OpenMW/openmw!2210
This commit is contained in:
psi29a 2022-07-31 17:31:11 +00:00
commit 42db39e281
3 changed files with 12 additions and 1 deletions

View file

@ -137,6 +137,7 @@
Bug #6753: Info records without a DATA subrecords are loaded incorrectly
Bug #6794: Light sources are attached to mesh bounds centers instead of mesh origins when AttachLight NiNode is missing
Bug #6799: Game crashes if an NPC has no Class attached
Bug #6818: ess-importer doesn't exactly reproduce camera
Bug #6849: ImageButton texture is not scaled properly
Bug #6869: Hits queue stagger during swing animation
Bug #6895: Removing a negative number of items from a script, makes the script terminate with an error

View file

@ -1,5 +1,7 @@
#include "convertplayer.hpp"
#include <cmath>
#include <components/misc/constants.hpp>
#include <components/misc/stringops.hpp>
@ -8,6 +10,8 @@ namespace ESSImport
void convertPCDT(const PCDT& pcdt, ESM::Player& out, std::vector<std::string>& outDialogueTopics, bool& firstPersonCam, bool& teleportingEnabled, bool& levitationEnabled, ESM::ControlsState& controls)
{
out.mObject.mPosition.rot[0] = -atan2(pcdt.mPNAM.mVerticalRotation.mData[2][1], pcdt.mPNAM.mVerticalRotation.mData[2][2]);
out.mBirthsign = pcdt.mBirthsign;
out.mObject.mNpcStats.mBounty = pcdt.mBounty;
for (const auto & essFaction : pcdt.mFactions)

View file

@ -66,6 +66,11 @@ struct PCDT
int mCellX, mCellY; // grid coordinates; for interior cells this is always (0, 0)
};
struct Rotation
{
float mData[3][3];
};
int mPlayerFlags; // controls, camera and draw state
unsigned int mLevelProgress;
float mSkillProgress[27]; // skill progress, non-uniform scaled
@ -76,7 +81,8 @@ struct PCDT
int mDetectEnchantmentMagnitude; // seems redundant
int mDetectAnimalMagnitude; // seems redundant
MarkLocation mMarkLocation;
unsigned char mUnknown3[40];
unsigned char mUnknown3[4];
Rotation mVerticalRotation;
unsigned char mSpecIncreases[3]; // number of skill increases for each specialization
unsigned char mUnknown4;
};