diff --git a/libraries/animation/src/AnimVariant.h b/libraries/animation/src/AnimVariant.h index 36d189f85c..7c14bfd096 100644 --- a/libraries/animation/src/AnimVariant.h +++ b/libraries/animation/src/AnimVariant.h @@ -14,6 +14,7 @@ #include #include #include +#include class AnimVariant { public: @@ -69,8 +70,11 @@ class AnimVariantMap { public: bool lookup(const std::string& key, bool defaultValue) const { + // check triggers first, then map if (key.empty()) { return defaultValue; + } else if (_triggers.find(key) != _triggers.end()) { + return true; } else { auto iter = _map.find(key); return iter != _map.end() ? iter->second.getBool() : defaultValue; @@ -129,8 +133,12 @@ public: void set(const std::string& key, const glm::quat& value) { _map[key] = AnimVariant(value); } void set(const std::string& key, const glm::mat4& value) { _map[key] = AnimVariant(value); } + void setTrigger(const std::string& key) { _triggers.insert(key); } + void clearTirggers() { _triggers.clear(); } + protected: std::map _map; + std::set _triggers; }; #endif // hifi_AnimVariant_h