mirror of
https://github.com/AxioDL/metaforce.git
synced 2025-12-09 09:07:43 +00:00
Migration to new ANIM extract
This commit is contained in:
40
DataSpec/DNACommon/RigInverter.hpp
Normal file
40
DataSpec/DNACommon/RigInverter.hpp
Normal file
@@ -0,0 +1,40 @@
|
||||
#ifndef __COMMON_RIGINVERTER_HPP__
|
||||
#define __COMMON_RIGINVERTER_HPP__
|
||||
|
||||
#include "zeus/CVector3f.hpp"
|
||||
#include "zeus/CQuaternion.hpp"
|
||||
|
||||
namespace DataSpec
|
||||
{
|
||||
namespace DNAANIM
|
||||
{
|
||||
|
||||
/** One-shot process to invert CINF armature into connected rig,
|
||||
* inverting rotations/translations of ANIM data to match */
|
||||
template <class CINFType>
|
||||
class RigInverter
|
||||
{
|
||||
public:
|
||||
struct Bone
|
||||
{
|
||||
const typename CINFType::Bone& m_origBone;
|
||||
zeus::CQuaternion m_inverter;
|
||||
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;
|
||||
public:
|
||||
RigInverter(const CINFType& cinf);
|
||||
const CINFType& getCINF() const {return m_cinf;}
|
||||
const std::vector<Bone>& getBones() const {return m_bones;}
|
||||
zeus::CQuaternion transformRotation(atUint32 boneId, const zeus::CQuaternion& origRot) const;
|
||||
zeus::CVector3f transformPosition(atUint32 boneId, const zeus::CVector3f& origPos, bool subDelta) const;
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif // __COMMON_RIGINVERTER_HPP__
|
||||
Reference in New Issue
Block a user