[osg-users] osg::Operation lags

Robert Osfield robert.osfield at gmail.com
Fri Mar 20 02:27:24 PDT 2009


HI Roman,

Is i the UpdateSensoeHMDOperation that is at fault?  Put your own timing
stats into your code and see how long this is tacking to run, my guess is
that it's cost will be rather sporadic - if this is the case then you need
to change the way you manage this code, such as by creating an
OperationThread that sits in the background and polls the device(s), and the
during the update thread it merges changes required.


Robert.

2009/3/20 Roman Grigoriev <grigoriev at gosniias.ru>

>  Hi Guys!
>
> I’d like to use osg::Operation to read sensor data to viewer orientation
>
> So I test simple operation but have strange results – lags in frame rate.
>
> I attach picture to demonstrate it
>
> My config osg 2.7.2 vista nvidia 8600m gt
>
> operationThread = new osg::OperationThread;
>
> osg::ref_ptr<UpdateSensorHMDOperation> updateOperation;
>
> updateOperation = new UpdateSensorHMDOperation();
>
> operationThread->add(updateOperation.get());
>
> operationThread->startThread();
>
> viewer->addUpdateOperation(updateOperation.get());
>
> class UpdateSensorHMDOperation : public osg::Operation
>
> {
>
> public:
>
>
>
>     UpdateSensorHMDOperation():
>
>         Operation("UpdateTextOperation", true),
>
>        _load(false),_valid1(false)
>
>     {
>
>              osg::notify(osg::NOTICE)<<"load update operation"<<std::endl;
>
>     }
>
>
>
>     virtual void operator () (osg::Object* callingObject)
>
>     {
>
>             osg::notify(osg::NOTICE)<<"update"<<std::endl;
>
>       }
>
>        virtual void release()
>
>        {
>
>
>
>        }
>
>
>
>       bool                               _load;
>
>       bool                               _valid1;
>
>
>
> };
>
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20090320/79aa1738/attachment-0003.htm>


More information about the osg-users mailing list