blob: c9fc226fc0aead1b38648d731dae08267560bb93 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
|
from pixelcore import PixelEvent
import Util, math
class DecayEvent(PixelEvent):
def initEvent(self):
self.validateArgs('DecayEvent.params')
self['Coefficient'] = abs(self['Coefficient'])
def state(self,timeDelay):
if self['DecayType'] == 'Exponential':
decay = math.exp(timeDelay*-1*self['Coefficient'])
if self['DecayType'] == 'Proportional':
decay = float(self['Coefficient']) / timeDelay
return Util.multiplyColor(self['Color'], decay)
|