1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2024-12-28 18:18:52 +00:00
OpenMW/components/esm/quaternion.hpp

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

30 lines
635 B
C++
Raw Normal View History

2024-05-02 01:09:13 +00:00
#ifndef OPENMW_COMPONENTS_ESM_QUATERNION_H
#define OPENMW_COMPONENTS_ESM_QUATERNION_H
#include <osg/Quat>
namespace ESM
{
// format 0, savegames only
struct Quaternion
{
float mValues[4];
Quaternion() = default;
Quaternion(const osg::Quat& q)
: mValues{
static_cast<float>(q.w()),
static_cast<float>(q.x()),
static_cast<float>(q.y()),
static_cast<float>(q.z()),
}
{
}
operator osg::Quat() const { return osg::Quat(mValues[1], mValues[2], mValues[3], mValues[0]); }
};
}
#endif