add getters from animation names and play animation method

This commit is contained in:
Nick Fisher
2022-03-22 22:33:50 +08:00
parent 8e3b530b46
commit 1410fb9ea7
6 changed files with 525 additions and 381 deletions

View File

@@ -54,6 +54,16 @@ namespace polyvox {
const int count;
};
struct EmbeddedAnimationBuffer {
EmbeddedAnimationBuffer(int animationIndex, float duration) : animationIndex(animationIndex), duration(duration) {}
bool hasStarted = false;
int animationIndex;
float duration = 0;
time_point_t lastTime;
};
struct ResourceBuffer {
ResourceBuffer(const void* data, const uint32_t size, const uint32_t id) : data(data), size(size), id(id) {};
@@ -102,6 +112,7 @@ namespace polyvox {
// void createMorpher(const char* meshName, int* primitives, int numPrimitives);
void releaseSourceAssets();
StringList getTargetNames(const char* meshName);
unique_ptr<vector<string>> getAnimationNames();
Manipulator<float>* manipulator;
void applyWeights(float* weights, int count);
void animateWeights(float* data, int numWeights, int length, float frameRate);
@@ -158,27 +169,16 @@ namespace polyvox {
float _cameraFocalLength = 0.0f;
void updateMorphAnimation();
// void updateEmbeddedAnimation();
void updateEmbeddedAnimation();
// animation flags;
bool isAnimating;
unique_ptr<MorphAnimationBuffer> morphAnimationBuffer;
// unique_ptr<EmbeddedAnimationBuffer> embeddedAnimationBuffer;
unique_ptr<EmbeddedAnimationBuffer> embeddedAnimationBuffer;
};
}
// struct EmbeddedAnimationBuffer {
// EmbeddedAnimationBuffer(int animationIndex, float duration) : animationIndex(animationIndex), duration(duration) {}
// bool hasStarted = false;
// int animationIndex;
// float duration = 0;
// time_point_t lastTime;
// };