From 75c184d7103b749aa70b6ac0b5904256a7155c49 Mon Sep 17 00:00:00 2001 From: Phillip Stephens Date: Fri, 13 Mar 2020 15:29:20 -0700 Subject: [PATCH] CHierarchyPoseBuilder corrections --- Runtime/Character/CHierarchyPoseBuilder.cpp | 8 ++++---- Runtime/Character/CHierarchyPoseBuilder.hpp | 8 +++----- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/Runtime/Character/CHierarchyPoseBuilder.cpp b/Runtime/Character/CHierarchyPoseBuilder.cpp index d4c843d32..763316e08 100644 --- a/Runtime/Character/CHierarchyPoseBuilder.cpp +++ b/Runtime/Character/CHierarchyPoseBuilder.cpp @@ -12,8 +12,8 @@ void CHierarchyPoseBuilder::BuildIntoHierarchy(const CCharLayoutInfo& layout, co if (!x38_treeMap.HasElement(boneId)) { const CCharLayoutNode::Bone& bone = layout.GetRootNode()->GetBoneMap()[boneId]; if (bone.x0_parentId == nullId) { - xcec_rootId = boneId; - xcf0_hasRoot = true; + x30_rootId = boneId; + x34_hasRoot = true; zeus::CVector3f origin = layout.GetFromParentUnrotated(boneId); CTreeNode& node = x38_treeMap[boneId]; node.x14_offset = origin; @@ -128,11 +128,11 @@ void CHierarchyPoseBuilder::BuildTransform(const CSegId& boneId, zeus::CTransfor void CHierarchyPoseBuilder::BuildNoScale(CPoseAsTransforms& pose) { pose.Clear(); - const CTreeNode& node = x38_treeMap[xcec_rootId]; + const CTreeNode& node = x38_treeMap[x30_rootId]; zeus::CQuaternion quat; zeus::CMatrix3f mtx; 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) { diff --git a/Runtime/Character/CHierarchyPoseBuilder.hpp b/Runtime/Character/CHierarchyPoseBuilder.hpp index 331929143..aeaa10035 100644 --- a/Runtime/Character/CHierarchyPoseBuilder.hpp +++ b/Runtime/Character/CHierarchyPoseBuilder.hpp @@ -14,7 +14,8 @@ class CPoseAsTransforms; class CHierarchyPoseBuilder { CLayoutDescription x0_layoutDesc; - bool x34_ = 0; + CSegId x30_rootId; + bool x34_hasRoot = false; struct CTreeNode { CSegId x0_child = 0; @@ -24,9 +25,6 @@ class CHierarchyPoseBuilder { }; TSegIdMap x38_treeMap; - 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, @@ -39,7 +37,7 @@ public: CHierarchyPoseBuilder(const CLayoutDescription& layout); const TLockedToken& 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 BuildNoScale(CPoseAsTransforms& pose); void Insert(const CSegId& boneId, const zeus::CQuaternion& quat);