From: Tim Moore Date: Sun, 26 Dec 2010 17:34:00 +0000 (+0100) Subject: set data variance to DYNAMIC for animated effect attributes X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=33e1a9457a356c339170d79d66253fac2dd1f825;p=simgear.git set data variance to DYNAMIC for animated effect attributes --- diff --git a/simgear/scene/material/EffectBuilder.hxx b/simgear/scene/material/EffectBuilder.hxx index c1d48405..a30efa5e 100644 --- a/simgear/scene/material/EffectBuilder.hxx +++ b/simgear/scene/material/EffectBuilder.hxx @@ -23,6 +23,7 @@ #include #include +#include #include #include @@ -578,6 +579,19 @@ new_EEPropListener(const Func& func, const std::string* propName, (func, 0, namesBegin, namesEnd); } +/** + * Set DYNAMIC data variance on an osg::Object. + */ + +inline void setDynamicVariance(void* obj) +{ +} + +inline void setDynamicVariance(osg::Object* obj) +{ + obj->setDataVariance(osg::Object::DYNAMIC); +} + /** * Initialize the value and the possible updating of an effect * attribute. If the value is specified directly, set it. Otherwise, @@ -598,6 +612,7 @@ initFromParameters(Effect* effect, const SGPropertyNode* prop, ObjType* obj, const SGPropertyNode* valProp = getEffectPropertyNode(effect, prop); if (!valProp) return; + setDynamicVariance(obj); if (valProp->nChildren() == 0) { setter(obj, valProp->getValue()); } else { @@ -650,6 +665,7 @@ initFromParameters(Effect* effect, const SGPropertyNode* prop, ObjType* obj, const SGPropertyNode* valProp = getEffectPropertyNode(effect, prop); if (!valProp) return; + setDynamicVariance(obj); if (valProp->nChildren() == 0) { // Has ? setter(obj, Bridge::get(valProp->getValue())); } else {