2018-10-07 03:42:33 +00:00
|
|
|
#pragma once
|
2015-08-23 06:42:29 +00:00
|
|
|
|
2016-04-13 23:07:18 +00:00
|
|
|
#include "CSegId.hpp"
|
2016-04-16 03:24:25 +00:00
|
|
|
#include "TSegIdMap.hpp"
|
2016-04-13 23:07:18 +00:00
|
|
|
#include "zeus/CQuaternion.hpp"
|
|
|
|
#include "CLayoutDescription.hpp"
|
|
|
|
|
2016-03-04 23:04:53 +00:00
|
|
|
namespace urde
|
2015-08-23 06:42:29 +00:00
|
|
|
{
|
2016-04-12 22:28:08 +00:00
|
|
|
class CLayoutDescription;
|
2016-04-13 23:07:18 +00:00
|
|
|
class CCharLayoutInfo;
|
|
|
|
class CPoseAsTransforms;
|
2015-08-23 06:42:29 +00:00
|
|
|
|
|
|
|
class CHierarchyPoseBuilder
|
|
|
|
{
|
2016-09-04 02:27:35 +00:00
|
|
|
CLayoutDescription x0_layoutDesc;
|
|
|
|
bool x34_ = 0;
|
|
|
|
|
|
|
|
|
2016-04-13 23:07:18 +00:00
|
|
|
struct CTreeNode
|
|
|
|
{
|
|
|
|
CSegId x0_child = 0;
|
|
|
|
CSegId x1_sibling = 0;
|
|
|
|
zeus::CQuaternion x4_rotation;
|
|
|
|
zeus::CVector3f x14_offset;
|
|
|
|
CTreeNode() = default;
|
|
|
|
CTreeNode(const zeus::CVector3f& offset) : x14_offset(offset) {}
|
2016-08-21 00:04:50 +00:00
|
|
|
CTreeNode(const zeus::CQuaternion& quat) : x4_rotation(quat) {}
|
|
|
|
CTreeNode(const zeus::CQuaternion& quat, const zeus::CVector3f& offset)
|
|
|
|
: x4_rotation(quat), x14_offset(offset) {}
|
2016-04-13 23:07:18 +00:00
|
|
|
};
|
2016-09-04 02:27:35 +00:00
|
|
|
TSegIdMap<CTreeNode> x38_treeMap;
|
2016-04-16 03:24:25 +00:00
|
|
|
|
2016-04-13 23:07:18 +00:00
|
|
|
CSegId xcec_rootId;
|
|
|
|
bool xcf0_hasRoot = false;
|
|
|
|
|
|
|
|
void BuildIntoHierarchy(const CCharLayoutInfo& layout,
|
|
|
|
const CSegId& boneId, const CSegId& nullId);
|
|
|
|
void RecursivelyBuildNoScale(const CSegId& boneId, const CTreeNode& node,
|
|
|
|
CPoseAsTransforms& pose, const zeus::CQuaternion& rot,
|
|
|
|
const zeus::CMatrix3f& scale, const zeus::CVector3f& offset) const;
|
|
|
|
void RecursivelyBuild(const CSegId& boneId, const CTreeNode& node,
|
|
|
|
CPoseAsTransforms& pose, const zeus::CQuaternion& rot,
|
|
|
|
const zeus::CMatrix3f& scale, const zeus::CVector3f& offset) const;
|
2016-04-12 22:28:08 +00:00
|
|
|
public:
|
|
|
|
CHierarchyPoseBuilder(const CLayoutDescription& layout);
|
2016-04-13 23:07:18 +00:00
|
|
|
|
2017-01-08 03:36:24 +00:00
|
|
|
const TLockedToken<CCharLayoutInfo> CharLayoutInfo() const { return x0_layoutDesc.ScaledLayout(); }
|
2016-08-21 20:39:18 +00:00
|
|
|
bool HasRoot() const { return xcf0_hasRoot; }
|
2016-04-13 23:07:18 +00:00
|
|
|
void BuildTransform(const CSegId& boneId, zeus::CTransform& xfOut) const;
|
|
|
|
void BuildNoScale(CPoseAsTransforms& pose);
|
2016-08-21 00:04:50 +00:00
|
|
|
void Insert(const CSegId& boneId, const zeus::CQuaternion& quat);
|
|
|
|
void Insert(const CSegId& boneId, const zeus::CQuaternion& quat, const zeus::CVector3f& offset);
|
2015-08-23 06:42:29 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|