ya2 · news · projects · code · about

refactoring of functional tests
[pmachines.git] / lib / lib / p3d / ivals.py
CommitLineData
8ee66edd
FC
1from direct.interval.MetaInterval import Sequence
2from direct.interval.FunctionInterval import Func, Wait
3from direct.interval.LerpInterval import LerpPosInterval
4
5
6class P3dSeq:
7
8 def __init__(self, *ivals):
9 self.seq = Sequence(*[ival._ival for ival in ivals])
10 #TODO: don't access a protected member
11
12 def start(self): return self.seq.start()
13
14 def __add__(self, ival):
15 self.seq.append(ival._ival) #TODO: don't access a protected member
16 return self.seq
17
18
19class P3dWait:
20
21 def __init__(self, time): self._ival = Wait(time)
22
23
24class P3dPosIval:
25
26 def __init__(self, node, time=1.0, pos=(0, 0, 0), blend_type='ease'):
27 btype = {'ease': 'easeInOut'}[blend_type]
28 self._ival = LerpPosInterval(node, time, pos=pos, blendType=btype)
29
30
31class P3dFunc:
32
33 def __init__(self, fun, *args): self._ival = Func(fun, *args)