mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-04 02:42:49 -04:00
*** empty log message ***
This commit is contained in:
parent
428dff7eaa
commit
0e24217d69
@ -20,7 +20,6 @@ class Interval(DirectObject):
|
|||||||
self.name = name
|
self.name = name
|
||||||
self.duration = duration
|
self.duration = duration
|
||||||
self.clock = ClockObject.ClockObject.getGlobalClock()
|
self.clock = ClockObject.ClockObject.getGlobalClock()
|
||||||
self.prevt = 0.0
|
|
||||||
|
|
||||||
def getName(self):
|
def getName(self):
|
||||||
""" getName()
|
""" getName()
|
||||||
@ -49,6 +48,7 @@ class Interval(DirectObject):
|
|||||||
self.startT = self.clock.getFrameTime() - t0
|
self.startT = self.clock.getFrameTime() - t0
|
||||||
assert(scale > 0.0)
|
assert(scale > 0.0)
|
||||||
self.scale = scale
|
self.scale = scale
|
||||||
|
self.firstTime = 1
|
||||||
if (duration == 0.0):
|
if (duration == 0.0):
|
||||||
self.playDuration = self.duration
|
self.playDuration = self.duration
|
||||||
else:
|
else:
|
||||||
@ -66,11 +66,13 @@ class Interval(DirectObject):
|
|||||||
t = self.clock.getFrameTime()
|
t = self.clock.getFrameTime()
|
||||||
te = (t - self.startT) * self.scale
|
te = (t - self.startT) * self.scale
|
||||||
if (te <= self.playDuration):
|
if (te <= self.playDuration):
|
||||||
self.setT(te, self.prevt)
|
if (self.firstTime):
|
||||||
self.prevt = te
|
self.setT(te, entry=1)
|
||||||
|
self.firstTime = 0
|
||||||
|
else:
|
||||||
|
self.setT(te)
|
||||||
return Task.cont
|
return Task.cont
|
||||||
else:
|
else:
|
||||||
self.prevt = te
|
|
||||||
return Task.done
|
return Task.done
|
||||||
|
|
||||||
def printParams(self, indent=0):
|
def printParams(self, indent=0):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user