[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kwin
Subject:    Re: physics-based animator
From:       Lubos Lunak <l.lunak () suse ! cz>
Date:       2008-03-18 12:00:29
Message-ID: 200803181300.29511.l.lunak () suse ! cz
[Download RAW message or body]

On Monday 17 of March 2008, Sebastian Kuegler wrote:
> On Monday 17 March 2008 12:16:02 Louai Al-Khanji wrote:
> > I thought about this last week as well. The idea I had was a class
> > where you can give the start and target values and duration. You could
> > then specify a curve type (linear, exponential, etc.) and specify some
> > parameters that affect the curve shape.
> >
> > Just an idea, I might even do something with it.

 Yes. As Rivo already said, Plasma::Phase doesn't fit KWin, for several 
reasons. In KWin, effects get the time in the pre-paint calls, and they build 
their internal time based on that. There's no QTimer, signals or anything 
like that.

> Good idea. :)
>
> For KWin effects, the easiest way to integrate such a thing would be to
> have a method "valueAtTime()" like QTimeLine has it. Then we can probably
> port most effects rather easily. Right now, all animation progress is based
> on a single double, which is then used to calculate position, size and so
> on.

 Yes. I think it could be something like:

.h:
 class FooEffect
...
   Progress effect_progress;
...
.cpp:
void FooEffect::prePaint( ... time ... )
...
  effect_progress.addTime( time );
  // and use effect_progress.value() further on

-- 
Lubos Lunak
KDE developer
--------------------------------------------------------------
SUSE LINUX, s.r.o.   e-mail: l.lunak@suse.cz , l.lunak@kde.org
Lihovarska 1060/12   tel: +420 284 028 972
190 00 Prague 9      fax: +420 284 028 951
Czech Republic       http://www.suse.cz
_______________________________________________
Kwin mailing list
Kwin@kde.org
https://mail.kde.org/mailman/listinfo/kwin
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic