X-Git-Url: https://git.lukelau.me/?p=opengl.git;a=blobdiff_plain;f=blendshapes.hpp;fp=blendshapes.hpp;h=d7081b1e48c673a0d3ca91dc8893a433dcaf499a;hp=fd3bcc4264cbb6a0957b32e275c603e9e3d9ad82;hb=9886c33eb8cd31f28234585718410cd51aef2a4c;hpb=d2a4cfcd292f5bc422a025d43855e5f4f21fb161 diff --git a/blendshapes.hpp b/blendshapes.hpp index fd3bcc4..d7081b1 100644 --- a/blendshapes.hpp +++ b/blendshapes.hpp @@ -1,10 +1,26 @@ #include "model.hpp" -struct Blendshapes { + +struct Blendshape { + std::string name; + std::vector deltas; + float weight; +}; + +struct BlendshapeModel { Model *model; std::vector neutral; - std::vector> deltas; + std::vector blendshapes; + std::vector> animation; + unsigned long curFrame = 0; }; -void createBlendshapes(std::vector blendshapes, std::string neutral, Program p, Blendshapes *res); +typedef std::pair VertIdx; + +void loadBlendshapes(std::string dir, Program p, BlendshapeModel *bsModel); +/* void createBlendshapes(std::vector blendshapes, std::string neutral, Program p, BlendshapeModel *res); */ + +void interpolateBlendshapes(BlendshapeModel *b); + +void solveWeights(BlendshapeModel *b, std::map manips); -void interpolateBlendshapes(Blendshapes *b, std::vector amounts); +void stepBlendshapeAnim(BlendshapeModel *b);