Merge branch 'master' of github.com:nmfisher/polyvox_filament

This commit is contained in:
Nick Fisher
2023-02-28 13:13:25 +08:00
7 changed files with 39 additions and 11 deletions

View File

@@ -198,6 +198,10 @@ extern "C" {
((SceneAsset*)asset)->playAnimation(index, loop, reverse);
}
void set_animation_frame(void* asset, int animationIndex, int animationFrame) {
((SceneAsset*)asset)->setAnimationFrame(animationIndex, animationFrame);
}
int get_animation_count(void* asset) {
auto names = ((SceneAsset*)asset)->getAnimationNames();
return names->size();

View File

@@ -346,6 +346,12 @@ void SceneAsset::setTexture() {
}
void SceneAsset::setAnimationFrame(int animationIndex, int animationFrame) {
auto offset = 60 * animationFrame * 1000; // TODO - don't hardcore 60fps framerate
_animator->applyAnimation(animationIndex, offset);
_animator->updateBoneMatrices();
}
void SceneAsset::updateEmbeddedAnimations() {
auto now = high_resolution_clock::now();