CHierarchyPoseBuilder corrections

This commit is contained in:
Phillip Stephens 2020-03-13 15:29:20 -07:00
parent df4487bae8
commit 75c184d710
Signed by: Antidote
GPG Key ID: F8BEE4C83DACA60D
2 changed files with 7 additions and 9 deletions

View File

@ -12,8 +12,8 @@ void CHierarchyPoseBuilder::BuildIntoHierarchy(const CCharLayoutInfo& layout, co
if (!x38_treeMap.HasElement(boneId)) { if (!x38_treeMap.HasElement(boneId)) {
const CCharLayoutNode::Bone& bone = layout.GetRootNode()->GetBoneMap()[boneId]; const CCharLayoutNode::Bone& bone = layout.GetRootNode()->GetBoneMap()[boneId];
if (bone.x0_parentId == nullId) { if (bone.x0_parentId == nullId) {
xcec_rootId = boneId; x30_rootId = boneId;
xcf0_hasRoot = true; x34_hasRoot = true;
zeus::CVector3f origin = layout.GetFromParentUnrotated(boneId); zeus::CVector3f origin = layout.GetFromParentUnrotated(boneId);
CTreeNode& node = x38_treeMap[boneId]; CTreeNode& node = x38_treeMap[boneId];
node.x14_offset = origin; node.x14_offset = origin;
@ -128,11 +128,11 @@ void CHierarchyPoseBuilder::BuildTransform(const CSegId& boneId, zeus::CTransfor
void CHierarchyPoseBuilder::BuildNoScale(CPoseAsTransforms& pose) { void CHierarchyPoseBuilder::BuildNoScale(CPoseAsTransforms& pose) {
pose.Clear(); pose.Clear();
const CTreeNode& node = x38_treeMap[xcec_rootId]; const CTreeNode& node = x38_treeMap[x30_rootId];
zeus::CQuaternion quat; zeus::CQuaternion quat;
zeus::CMatrix3f mtx; zeus::CMatrix3f mtx;
zeus::CVector3f vec; zeus::CVector3f vec;
RecursivelyBuildNoScale(xcec_rootId, node, pose, quat, mtx, vec); RecursivelyBuildNoScale(x30_rootId, node, pose, quat, mtx, vec);
} }
void CHierarchyPoseBuilder::Insert(const CSegId& boneId, const zeus::CQuaternion& quat) { void CHierarchyPoseBuilder::Insert(const CSegId& boneId, const zeus::CQuaternion& quat) {

View File

@ -14,7 +14,8 @@ class CPoseAsTransforms;
class CHierarchyPoseBuilder { class CHierarchyPoseBuilder {
CLayoutDescription x0_layoutDesc; CLayoutDescription x0_layoutDesc;
bool x34_ = 0; CSegId x30_rootId;
bool x34_hasRoot = false;
struct CTreeNode { struct CTreeNode {
CSegId x0_child = 0; CSegId x0_child = 0;
@ -24,9 +25,6 @@ class CHierarchyPoseBuilder {
}; };
TSegIdMap<CTreeNode> x38_treeMap; TSegIdMap<CTreeNode> x38_treeMap;
CSegId xcec_rootId;
bool xcf0_hasRoot = false;
void BuildIntoHierarchy(const CCharLayoutInfo& layout, const CSegId& boneId, const CSegId& nullId); void BuildIntoHierarchy(const CCharLayoutInfo& layout, const CSegId& boneId, const CSegId& nullId);
void RecursivelyBuildNoScale(const CSegId& boneId, const CTreeNode& node, CPoseAsTransforms& pose, void RecursivelyBuildNoScale(const CSegId& boneId, const CTreeNode& node, CPoseAsTransforms& pose,
const zeus::CQuaternion& rot, const zeus::CMatrix3f& scale, const zeus::CQuaternion& rot, const zeus::CMatrix3f& scale,
@ -39,7 +37,7 @@ public:
CHierarchyPoseBuilder(const CLayoutDescription& layout); CHierarchyPoseBuilder(const CLayoutDescription& layout);
const TLockedToken<CCharLayoutInfo>& CharLayoutInfo() const { return x0_layoutDesc.ScaledLayout(); } const TLockedToken<CCharLayoutInfo>& CharLayoutInfo() const { return x0_layoutDesc.ScaledLayout(); }
bool HasRoot() const { return xcf0_hasRoot; } bool HasRoot() const { return x34_hasRoot; }
void BuildTransform(const CSegId& boneId, zeus::CTransform& xfOut) const; void BuildTransform(const CSegId& boneId, zeus::CTransform& xfOut) const;
void BuildNoScale(CPoseAsTransforms& pose); void BuildNoScale(CPoseAsTransforms& pose);
void Insert(const CSegId& boneId, const zeus::CQuaternion& quat); void Insert(const CSegId& boneId, const zeus::CQuaternion& quat);