[osg-users] Bug in Viewer::setReferenceTime

2015-06-06 Thread Benjamin Richter

Hi everybody.

I was having some trouble with Viewer::setReferenceTime today and while 
debugging found the issue in the following line [1]


double delta_ticks = 
(time-currentTime)*(osg::Timer::instance()-getSecondsPerTick());


As currentTime and time are given in seconds (see link below for 
context) but the result should be in ticks, dividing by 
getSecondsPerTick would be correct.


(Apart from that: Thank you for this great library :D)

Regards
Benjamin

[1] 
https://github.com/openscenegraph/osg/blob/3c55e5bc765aff03ed0850ef9b9b62dc6aabe6a8/src/osgViewer/Viewer.cpp#L446

___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Insight into osg::Operation

2015-06-06 Thread Sebastian Messerschmidt

Okay, sorry for the noise.
My problem was a optimizer-run right after the scene was loaded, which 
of course might collapse groups.

Any thoughts on how to optimize in the background anyways?

Cheers
Sebastian
I found out, that the crash occurs when a osg:Group is traversed by 
the intersection visitor.
This is akward.. is the rendering thread somehow modifying children of 
the scene?


cheers
Sebastian

Hi,

I need some help with the osg::Operation.
What I'm trying to achieve seems relatively simple. After loading a 
model, I want some background operation to visit with an 
intersections visitor.

Pseudo code:
Load Node
Create osg::Operation-derived ref_ptr and do
mThreadedOperations-add(operation);
viewer-addUpdateOperation(operation);
during runtime (e.g. before viewer.frame())

Unfortunately I'm experiencing crashes (vector iterator not 
dereferenceable etc) in the intersection visitor ( to be more exact: 
in the node-accept(*mIntersectionVisitor))
It works flawlessly if I let the body of the operation execute 
blocking after loading.


In my osg::Operation::operator()(osg::Object*) implementation I'm 
using the following scheme:


osgViewer::Viewer* viewer = 
dynamic_castosgViewer::Viewer*(callingObject);

if (viewer)
{
return;
}
else
{
runTheIntersectionVisitor(); ...
}
Is there anything else I need to know? Examples for the 
osg::Operation are rare and I don't see from the given implementation 
if I need to lock anything.


Can someone give some insight on this?

Cheers
Sebastian
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org 



___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Insight into osg::Operation

2015-06-06 Thread Sebastian Messerschmidt
I found out, that the crash occurs when a osg:Group is traversed by the 
intersection visitor.
This is akward.. is the rendering thread somehow modifying children of 
the scene?


cheers
Sebastian

Hi,

I need some help with the osg::Operation.
What I'm trying to achieve seems relatively simple. After loading a 
model, I want some background operation to visit with an intersections 
visitor.

Pseudo code:
Load Node
Create osg::Operation-derived ref_ptr and do
mThreadedOperations-add(operation);
viewer-addUpdateOperation(operation);
during runtime (e.g. before viewer.frame())

Unfortunately I'm experiencing crashes (vector iterator not 
dereferenceable etc) in the intersection visitor ( to be more exact: 
in the node-accept(*mIntersectionVisitor))
It works flawlessly if I let the body of the operation execute 
blocking after loading.


In my osg::Operation::operator()(osg::Object*) implementation I'm 
using the following scheme:


osgViewer::Viewer* viewer = 
dynamic_castosgViewer::Viewer*(callingObject);

if (viewer)
{
return;
}
else
{
runTheIntersectionVisitor(); ...
}
Is there anything else I need to know? Examples for the osg::Operation 
are rare and I don't see from the given implementation if I need to 
lock anything.


Can someone give some insight on this?

Cheers
Sebastian
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org