ADD: Scene animation

This commit is contained in:
2025-11-17 13:54:19 +09:00
parent 84ba26ee2b
commit 24089dc325
6 changed files with 569 additions and 9 deletions

View File

@@ -66,8 +66,21 @@ public:
void addGLTFInstance(const std::string &name, std::shared_ptr<LoadedGLTF> scene,
const glm::mat4 &transform = glm::mat4(1.f));
bool removeGLTFInstance(const std::string &name);
bool setGLTFInstanceTransform(const std::string &name, const glm::mat4 &transform);
void clearGLTFInstances();
// Animation control helpers (glTF)
// Note: a LoadedGLTF may be shared by multiple instances; changing
// the active animation on a scene or instance affects all users
// of that shared LoadedGLTF.
bool setSceneAnimation(const std::string &sceneName, int animationIndex, bool resetTime = true);
bool setSceneAnimation(const std::string &sceneName, const std::string &animationName, bool resetTime = true);
bool setSceneAnimationLoop(const std::string &sceneName, bool loop);
bool setGLTFInstanceAnimation(const std::string &instanceName, int animationIndex, bool resetTime = true);
bool setGLTFInstanceAnimation(const std::string &instanceName, const std::string &animationName, bool resetTime = true);
bool setGLTFInstanceAnimationLoop(const std::string &instanceName, bool loop);
struct SceneStats
{
float scene_update_time = 0.f;