Hello i have a scenario, an ambient light named self.__sunlight and i want do a daycycle effect (Sun, Moon) changing ambient RGB values. then i have this methods on my FSM.
The problem is RARE, too rare i think, when i set the machine to SunState the colors start to up good, but if before that color value UP to 1.0, i cut the lerpFunc when the light RGB go in 0.6 and set the machine to MoonState, this stop and finish the current lerpFunc (in exitSunState),
later MUST start the MoonState lerpFunc, starting down FROM THE CURRENT COLOR VALUE CUTTED 0.6 (Because i finish it!)
but i can see a rare action of panda3d, i see as the ambientlight is setted directly to 1.0 and later start to down until 0.3…
the question is WHY set 1.0! if i cut the process before, in 0.6
And why this bug not is repeated when i cut MoonState to SunState, but yes in SunState to MoonState ?
When i cut MoonState to SunState, the screens NOT seted to the minimun 0.3 (look todata of lerp)
Why when cut SunState for set MoonState yes?
def enterMoonState(self):
print 'moon'
self.__intervals['sunlight_fade'] = LerpFunc(self.__set_sunlight, fromData = self.__sunlight.getColor()[0], toData = 0.3, duration = 5.0, blendType = 'noBlend', extraArgs = [], name ='sunlight_fade')
self.__intervals['sunlight_fade'].start()
def exitMoontState(self):
if self.__intervals.has_key('sunlight_fade'):
self.__intervals['sunlight_fade'].finish()
del(self.__intervals['sunlight_fade'])
def enterSunState(self):
print 'sun'
self.__intervals['sunlight_fade'] = LerpFunc(self.__set_sunlight, fromData = self.__sunlight.getColor()[0], toData = 1.0, duration = 5.0, blendType='noBlend', extraArgs = [], name = 'sunlight_fade')
self.__intervals['sunlight_fade'].start()
def exitSunState(self):
if self.__intervals.has_key('sunlight_fade'):
self.__intervals['sunlight_fade'].finish()
del(self.__intervals['sunlight_fade'])