#ifndef OPENMW_COMPONENTS_SCENEUTIL_ANIMBLENDRULES_HPP #define OPENMW_COMPONENTS_SCENEUTIL_ANIMBLENDRULES_HPP #include #include #include #include #include namespace SceneUtil { class AnimBlendRules : public osg::Object { public: struct BlendRule { std::string mFromGroup; std::string mFromKey; std::string mToGroup; std::string mToKey; float mDuration; std::string mEasing; }; AnimBlendRules() = default; AnimBlendRules(const std::vector& rules); AnimBlendRules(const AnimBlendRules& copy, const osg::CopyOp& copyop); META_Object(SceneUtil, AnimBlendRules) void addOverrideRules(const AnimBlendRules& overrideRules); std::optional findBlendingRule( std::string fromGroup, std::string fromKey, std::string toGroup, std::string toKey) const; const std::vector& getRules() const { return mRules; } static osg::ref_ptr fromFile(const VFS::Manager* vfs, VFS::Path::NormalizedView yamlpath); private: std::vector mRules; inline bool fitsRuleString(const std::string_view str, const std::string_view ruleStr) const; }; } #endif