Vincent Bourdier wrote on Thursday, August 07, 2008 9:56 AM:

> Hi,
> 
> I just need to move a light, and for that I try to use a callback.
> So I implement a simple class lightMoveCallback : public
> osg::StateAttribute::Callback 
> 
> with virtual void operator()(osg::StateAttribute* ss,
osg::NodeVisitor* nv);
> 
> but the callback is never called...
> 
> I use :
> light->setUpdateCallback(new lightMoveCallback())

Not sure what you're doing with your callback, but in OSG, lights are
positioned using a LightSource node, so perhaps your callback changes
are being overridden by that? The LightSource node is placed in the
scenegraph where you want the light to be, usually under a Transform.
Typically, to move the light, you can just add a UpdateCallback to the
Transform to do what you want.

I don't know why your callback isn't called, though.

HTH,
-- 
Bryan Thrall
FlightSafety International
[EMAIL PROTECTED]
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to