Added xml defined property/property animation to .p3d format for <volume> propeties:

alpha="$alphaname"
   cutoff="$cutoffname"
   region="$minx $miny $minz $maxx $maxy $maxz"
   sampleDensity="$densityname"
   sampleDensityWhenMoving="$densityname"
This commit is contained in:
Robert Osfield
2012-11-30 14:21:45 +00:00
parent 7ffde8abce
commit 236e75b2be
6 changed files with 274 additions and 30 deletions

View File

@@ -15,6 +15,24 @@
using namespace osgPresentation;
const osg::Object* osgPresentation::getUserObject(const osg::NodePath& nodepath, const std::string& name)
{
for(osg::NodePath::const_reverse_iterator itr = nodepath.rbegin();
itr != nodepath.rend();
++itr)
{
const osg::UserDataContainer* udc = (*itr)->getUserDataContainer();
const osg::Object* object = udc ? udc->getUserObject(name) : 0;
if (object) return object;
}
return 0;
}
bool osgPresentation::containsPropertyReference(const std::string& str)
{
return (str.find('$')!=std::string::npos);
}
void PropertyAnimation::reset()