From 7f13bfd20551801cee0146a9b427efbacef27a14 Mon Sep 17 00:00:00 2001 From: Mark Mine Date: Wed, 14 Mar 2001 03:21:44 +0000 Subject: [PATCH] *** empty log message *** --- direct/src/interval/IntervalTest.py | 2 +- direct/src/interval/LerpInterval.py | 12 ++++++------ direct/src/interval/Track.py | 15 +++++++++++++-- 3 files changed, 20 insertions(+), 9 deletions(-) diff --git a/direct/src/interval/IntervalTest.py b/direct/src/interval/IntervalTest.py index bfdb61380f..814054f272 100644 --- a/direct/src/interval/IntervalTest.py +++ b/direct/src/interval/IntervalTest.py @@ -33,7 +33,7 @@ dockUpTime = BOAT_END - dockLerp.getDuration() hpr2 = Vec3(90.0, 90.0, 90.0) dockLerp2 = LerpHprInterval(dock, 3.0, hpr2, name='hpr-lerp') dockTrack = Track([dockLerp2, dockPos, dockLerp], 'docktrack') -dockTrack.setIntervalStartTime('lerp', dockUpTime) +dockTrack.setIntervalStartTime('dock-lerp', dockUpTime) dockTrack.setIntervalStartTime('hpr-lerp', BOAT_START) # Start the water sound 5 seconds after the boat starts moving diff --git a/direct/src/interval/LerpInterval.py b/direct/src/interval/LerpInterval.py index 013b5099e9..3712959539 100644 --- a/direct/src/interval/LerpInterval.py +++ b/direct/src/interval/LerpInterval.py @@ -80,8 +80,8 @@ class LerpPosHprInterval(LerpInterval): return functor if (name == None): - n = 'LerpPosHpr-%d' % self.lerpPosHprNum - self.lerpPosHprNum = self.lerpPosHprNum + 1 + n = 'LerpPosHpr-%d' % LerpPosHprInterval.lerpPosHprNum + LerpPosHprInterval.lerpPosHprNum += 1 else: n = name @@ -115,8 +115,8 @@ class LerpPosInterval(LerpInterval): return functor if (name == None): - n = 'LerpPos-%d' % self.lerpPosNum - self.lerpPosNum = self.lerpPosNum + 1 + n = 'LerpPos-%d' % LerpPosInterval.lerpPosNum + LerpPosInterval.lerpPosNum += 1 else: n = name @@ -149,8 +149,8 @@ class LerpHprInterval(LerpInterval): return functor if (name == None): - n = 'LerpHpr-%d' % self.lerpHprNum - self.lerpHprNum = self.lerpHprNum + 1 + n = 'LerpHpr-%d' % LerpHprInterval.lerpHprNum + LerpHprInterval.lerpHprNum += 1 else: n = name diff --git a/direct/src/interval/Track.py b/direct/src/interval/Track.py index 44f9c44d5c..425a376b01 100644 --- a/direct/src/interval/Track.py +++ b/direct/src/interval/Track.py @@ -30,7 +30,18 @@ class Track(Interval): def __buildIlist(self, intervalList): self.ilist = [] for i in intervalList: - self.ilist.append((i, 0.0, PREVIOUS_END)) + if isinstance(i, Interval): + self.ilist.append((i, 0.0, PREVIOUS_END)) + elif isinstance(i, ListType) or isinstance(i, TupleType): + t0 = i[0] + ival = i[1] + try: + type = i[2] + except IndexError: + type = TRACK_START + self.ilist.append((ival, t0, type)) + else: + print 'Track.__buildIlist: Invalid intervallist entry' def __computeDuration(self, length): """ __computeDuration(length) @@ -45,7 +56,7 @@ class Track(Interval): assert(t0 >= 0.0) fillTime = t0 if (type == PREVIOUS_END): - pass + pass elif (type == PREVIOUS_START): if (prev != None): fillTime = t0 - prev.getDuration()