Hi Robert,

Is your idea to break up the function of ::color and make flexible the portions 
that determine what the sequence computes?

So, would the default encapsulate the code from line 160 on?

osgSim::BlinkSequence::color:160

    // accumulate final part of the first active pulses.
    osg::Vec4 color(itr->second*(itr->first-lt));
    double len = length-(itr->first-lt);
    ++itr;
    if (itr==_pulseData.end()) itr = _pulseData.begin();

    // accumulate all the whole pluses pulses.
    while (len>itr->first)
    {
        len -= itr->first;
        color += itr->second*itr->first;
        ++itr;
        if (itr==_pulseData.end()) itr = _pulseData.begin();
    }

    // add remaining part of the final pulse.
    color += itr->second*len;

    // normalise the time waited color.   
    color /= length;

    return color;

-B

-----Original Message-----
From: [email protected] 
[mailto:[email protected]] On Behalf Of Robert 
Osfield
Sent: Tuesday, June 26, 2012 10:00 AM
To: [email protected]
Subject: Re: [osg-submissions] Submission: osgSim::BlinkSequence::color changed 
to virtual

Hi Brad,

I wonder if it might be better to have the BlinkSequence change so
that it virtual combine(Vec4& colour, double time, double length)
method rather than the color() one, this method would take the source
colour from the LightPoint and then do whatever it wanted with it,
doing the default modulate to replicate the current functionality or
to re-implement anything that the custom BlinkSequence desires.

Robert.

On 25 June 2012 18:17, Brad Colbert <[email protected]> wrote:
> Hi Robert,
>
> Here is my submission that changes the osgSim::BlinkSequence::color member 
> function from inline to virtual.
>
> I hope you accept it.
>
>
> Thank you!
>
> Cheers,
> Brad
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=48491#48491
>
>
>
>
> Attachments:
> http://forum.openscenegraph.org//files/blinksequence_159.cpp
> http://forum.openscenegraph.org//files/3100_1340644611._614.
>
>
> _______________________________________________
> osg-submissions mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
_______________________________________________
osg-submissions mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
_______________________________________________
osg-submissions mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org

Reply via email to