Fix light data being reset for the wrong light

pull/1199/head
scrawl 8 years ago
parent c68f662c9a
commit 839928e210

@ -294,6 +294,13 @@ namespace SceneUtil
DisableLight(const DisableLight& copy,const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY)
: osg::StateAttribute(copy,copyop), mIndex(copy.mIndex) {}
virtual osg::Object* cloneType() const { return new DisableLight(mIndex); }
virtual osg::Object* clone(const osg::CopyOp& copyop) const { return new DisableLight(*this,copyop); }
virtual bool isSameKindAs(const osg::Object* obj) const { return dynamic_cast<const DisableLight *>(obj)!=NULL; }
virtual const char* libraryName() const { return "SceneUtil"; }
virtual const char* className() const { return "DisableLight"; }
virtual Type getType() const { return LIGHT; }
unsigned int getMember() const
{
return mIndex;
@ -310,8 +317,6 @@ namespace SceneUtil
throw std::runtime_error("DisableLight::compare: unimplemented");
}
META_StateAttribute(SceneUtil, DisableLight, osg::StateAttribute::LIGHT)
virtual void apply(osg::State& state) const
{
int lightNum = GL_LIGHT0 + mIndex;

Loading…
Cancel
Save