mirror of
https://github.com/AxioDL/metaforce.git
synced 2025-12-09 11:47:43 +00:00
New code style refactor
This commit is contained in:
@@ -5,40 +5,37 @@
|
||||
#include "zeus/CQuaternion.hpp"
|
||||
#include "hecl/hecl.hpp"
|
||||
|
||||
namespace DataSpec::DNAANIM
|
||||
{
|
||||
namespace DataSpec::DNAANIM {
|
||||
|
||||
/** One-shot process to invert CINF armature into connected rig,
|
||||
* inverting rotations/translations of ANIM data to match */
|
||||
template <class CINFType>
|
||||
class RigInverter
|
||||
{
|
||||
class RigInverter {
|
||||
public:
|
||||
struct Bone
|
||||
{
|
||||
const typename CINFType::Bone& m_origBone;
|
||||
zeus::CMatrix3f m_inverter;
|
||||
zeus::CMatrix3f m_restorer;
|
||||
zeus::CVector3f m_tail;
|
||||
zeus::CVector3f m_parentDelta;
|
||||
Bone(const CINFType& cinf, const typename CINFType::Bone& origBone);
|
||||
};
|
||||
struct Bone {
|
||||
const typename CINFType::Bone& m_origBone;
|
||||
zeus::CMatrix3f m_inverter;
|
||||
zeus::CMatrix3f m_restorer;
|
||||
zeus::CVector3f m_tail;
|
||||
zeus::CVector3f m_parentDelta;
|
||||
Bone(const CINFType& cinf, const typename CINFType::Bone& origBone);
|
||||
};
|
||||
|
||||
private:
|
||||
const CINFType& m_cinf;
|
||||
std::vector<Bone> m_bones;
|
||||
const CINFType& m_cinf;
|
||||
std::vector<Bone> m_bones;
|
||||
|
||||
public:
|
||||
RigInverter(const CINFType& cinf);
|
||||
RigInverter(const CINFType& cinf,
|
||||
const std::unordered_map<std::string, hecl::blender::Matrix3f>& matrices);
|
||||
const CINFType& getCINF() const {return m_cinf;}
|
||||
const std::vector<Bone>& getBones() const {return m_bones;}
|
||||
RigInverter(const CINFType& cinf);
|
||||
RigInverter(const CINFType& cinf, const std::unordered_map<std::string, hecl::blender::Matrix3f>& matrices);
|
||||
const CINFType& getCINF() const { return m_cinf; }
|
||||
const std::vector<Bone>& getBones() const { return m_bones; }
|
||||
|
||||
zeus::CQuaternion invertRotation(atUint32 boneId, const zeus::CQuaternion& origRot) const;
|
||||
zeus::CVector3f invertPosition(atUint32 boneId, const zeus::CVector3f& origPos, bool subDelta) const;
|
||||
zeus::CQuaternion invertRotation(atUint32 boneId, const zeus::CQuaternion& origRot) const;
|
||||
zeus::CVector3f invertPosition(atUint32 boneId, const zeus::CVector3f& origPos, bool subDelta) const;
|
||||
|
||||
zeus::CQuaternion restoreRotation(atUint32 boneId, const zeus::CQuaternion& origRot) const;
|
||||
zeus::CVector3f restorePosition(atUint32 boneId, const zeus::CVector3f& origPos, bool subDelta) const;
|
||||
zeus::CQuaternion restoreRotation(atUint32 boneId, const zeus::CQuaternion& origRot) const;
|
||||
zeus::CVector3f restorePosition(atUint32 boneId, const zeus::CVector3f& origPos, bool subDelta) const;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
} // namespace DataSpec::DNAANIM
|
||||
|
||||
Reference in New Issue
Block a user