*** empty log message ***

This commit is contained in:
Mike Goslin 2001-03-07 00:15:11 +00:00
parent c60ab78e2e
commit b29608ae00

View File

@ -46,7 +46,8 @@ class Interval(DirectObject):
def play(self, t0=0.0, duration=0.0, scale=1.0): def play(self, t0=0.0, duration=0.0, scale=1.0):
""" play(t0, duration) """ play(t0, duration)
""" """
self.startT = self.clock.getFrameTime() - t0 self.offset = t0
self.startT = self.clock.getFrameTime()
assert(scale > 0.0) assert(scale > 0.0)
self.scale = scale self.scale = scale
self.firstTime = 1 self.firstTime = 1
@ -54,6 +55,7 @@ class Interval(DirectObject):
self.playDuration = self.duration self.playDuration = self.duration
else: else:
self.playDuration = duration self.playDuration = duration
assert(t0 <= self.playDuration)
taskMgr.spawnMethodNamed(self.__playTask, self.name + '-play') taskMgr.spawnMethodNamed(self.__playTask, self.name + '-play')
def stop(self): def stop(self):
@ -66,7 +68,7 @@ class Interval(DirectObject):
""" __playTask(task) """ __playTask(task)
""" """
t = self.clock.getFrameTime() t = self.clock.getFrameTime()
te = (t - self.startT) * self.scale te = self.offset + ((t - self.startT) * self.scale)
self.curr_t = te self.curr_t = te
if (te <= self.playDuration): if (te <= self.playDuration):
if (self.firstTime): if (self.firstTime):