From d948e434ddbbc0706cecc934a9bc0dbb1ac8bb27 Mon Sep 17 00:00:00 2001 From: sabrina-shanman Date: Fri, 13 Sep 2019 09:54:46 -0700 Subject: [PATCH] DyanamicTransform concept --- libraries/hfm/src/hfm/HFM.h | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/libraries/hfm/src/hfm/HFM.h b/libraries/hfm/src/hfm/HFM.h index 33b02819d2..959fc0dc28 100644 --- a/libraries/hfm/src/hfm/HFM.h +++ b/libraries/hfm/src/hfm/HFM.h @@ -287,10 +287,22 @@ public: bool shouldInitCollisions() const { return _collisionsConfig.size() > 0; } }; -class ShapeTransform { - std::vector clusters; - Extents meshExtents; - Transform modelTransform; +class TransformNode { + uint32_t parent { 0 }; + Transform transform; +}; + +// Formerly contained in hfm::Mesh +class Deformer { + std::vector indices; + std::vector weights; +}; + +class DynamicTransform { + std::vector deformers; + std::vector clusters; // affect the deformer of the same index + std::vector blendshapes; + // There is also the modelTransform, which for now is left in hfm::Mesh }; // The lightweight model part description. @@ -299,7 +311,8 @@ public: uint32_t mesh; uint32_t meshPart; uint32_t material; - uint32_t shapeTransform; + uint32_t transform; // The static transform node when not taking into account rigging/skinning + uint32_t dynamicTransform; }; /// The runtime model format. @@ -316,8 +329,9 @@ public: std::vector meshes; std::vector materials; - std::vector shapeTransforms; + std::vector deformers; + std::vector transforms; std::vector joints; QHash jointIndices; ///< 1-based, so as to more easily detect missing indices bool hasSkeletonJoints;