Browse Source

*** empty log message ***

Mark Mine 25 years ago
parent
commit
7f13bfd205

+ 1 - 1
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

+ 6 - 6
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
 

+ 13 - 2
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()