From Cedric Pinson, "Here a patch to be able to clone stateattribute, in order to do that i
moved the StateAttribute::Callback structure to a file StateAttributeCallback with the same behavior as NodeCallback. "
This commit is contained in:
@@ -122,13 +122,13 @@ bool UpdateTransform::link(osgAnimation::Channel* channel)
|
||||
|
||||
UpdateMaterial::UpdateMaterial(const UpdateMaterial& apc,const osg::CopyOp& copyop)
|
||||
: osg::Object(apc, copyop),
|
||||
AnimationUpdateCallback<osg::StateAttribute::Callback>(apc, copyop)
|
||||
AnimationUpdateCallback<osg::StateAttributeCallback>(apc, copyop)
|
||||
{
|
||||
_diffuse = new osgAnimation::Vec4Target(apc._diffuse->getValue());
|
||||
}
|
||||
|
||||
UpdateMaterial::UpdateMaterial(const std::string& name):
|
||||
AnimationUpdateCallback<osg::StateAttribute::Callback>(name)
|
||||
AnimationUpdateCallback<osg::StateAttributeCallback>(name)
|
||||
{
|
||||
_diffuse = new osgAnimation::Vec4Target(osg::Vec4(1,0,1,1));
|
||||
}
|
||||
@@ -144,6 +144,8 @@ void UpdateMaterial::operator()(osg::StateAttribute* sa, osg::NodeVisitor* nv)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
osgAnimation::Vec4Target* UpdateMaterial::getDiffuse() { return _diffuse.get(); }
|
||||
void UpdateMaterial::update(osg::Material& material)
|
||||
{
|
||||
osg::Vec4 diffuse = _diffuse->getValue();
|
||||
|
||||
Reference in New Issue
Block a user