Re: [osg-users] Get Animation current time

2019-01-08 Thread Robert Osfield
Good to hear you've resolved the problems and got things working really efficiently ;-) On Tue, 8 Jan 2019 at 14:11, Diego Mancilla wrote: > > Hello Robert, > > Thank you again. > > It turns out that I forgot to initialize the _timeMultiplier variable on the > constructor of my AnimationPath cl

Re: [osg-users] Get Animation current time

2019-01-08 Thread Diego Mancilla
Hello Robert, Thank you again. It turns out that I forgot to initialize the _timeMultiplier variable on the constructor of my AnimationPath class. Also I had a problem with some crazy references retrieved wrongly: for some reason on a "for (auto e: stl_map)..." loop, &e.second, was not gettin

Re: [osg-users] Get Animation current time

2019-01-08 Thread Robert Osfield
HI Diego, I can point you in the right direction but I can't sit beside you and walk through your code in a debugger. When figuring out a crash this is what is needed. The only thing I can add is that using raw C pointer is generally a red flag and one should be very cautious about doing so. Th

Re: [osg-users] Get Animation current time

2019-01-07 Thread Diego Mancilla
Hello Robert, Thank you very much for you complete response. I'm trying to do what you suggest and have my on AnimationPath/AnimationPathCallback classes that handle my data. But I stumble into a problem. When I subclass AnimationPath and AnimationPathCallback I have no problems. But when I

Re: [osg-users] Get Animation current time

2019-01-04 Thread Robert Osfield
Hi Diego, On Fri, 4 Jan 2019 at 16:16, Diego Mancilla wrote: > I have another question rather technical. As per now a have a lot of moving > objects. I'm using standard AnimationPath instances for each one of them. > Also y have a lot a control points for each one (20k+). So filling the > Anim

Re: [osg-users] Get Animation current time

2019-01-04 Thread Diego Mancilla
Hello Robert, Thank you again for your answer. Regarding your question "the AnimationPathCallback::update method)?": yes, from the source: Code: void AnimationPathCallback::update(osg::Node& node) { AnimationPath::ControlPoint cp; if (_animationPath->getInterpolatedControlPoint(getAnim

Re: [osg-users] Get Animation current time

2018-12-30 Thread Robert Osfield
Hi Diego, On Fri, 28 Dec 2018 at 14:31, Diego Mancilla wrote: > So: > 1 - Can I, from the osg::FrameStamp instance "reconstruct" the current > animation time from the AnimationPath instances or from anywhere else? The FrameStamp is set up in the Viewer::advance(..) method, you can pass a simula

Re: [osg-users] Get Animation current time

2018-12-28 Thread Diego Mancilla
Hello Robert, First of all, thank you for your answer. I'm just starting to use OSG so I'm learning as I go. So, my issue is a little more complicated (I think). I have serveral AnimationPath instances. Each one with a AnimationPathCallback derived class attached to it. So, the thing is that

Re: [osg-users] Get Animation current time

2018-12-28 Thread Robert Osfield
HI Diego, The OSG uses an osg::FrameStamp for each new frame, this is accessible from the Viewer and the different traversals like UpdateVisitor/EventVisitor/CulllVisitor and the draw traversal. Individual animations like AnimantionPath can have their own local animation speed that take the FrameS

[osg-users] Get Animation current time

2018-12-27 Thread Diego Mancilla
Hello, I have several AnimationPath intances for a number of moving objects. Each object has the same number of ControlPoints on their path. I need to know if there is a proper way to retrieve the current time of the animation (using a callback, for instance). I need this number in order to d