mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-04 19:08:55 -04:00
*** empty log message ***
This commit is contained in:
parent
b3776c71b3
commit
189b58fcd3
@ -8,16 +8,20 @@ class LerpInterval(Interval):
|
||||
|
||||
# special methods
|
||||
|
||||
def __init__(self, name, duration, functor, blendType='noBlend'):
|
||||
"""__init__(name, duration, functor, blendType)
|
||||
def __init__(self, name, duration, functorFunc, blendType='noBlend'):
|
||||
"""__init__(name, duration, functorFunc, blendType)
|
||||
"""
|
||||
self.lerp = Lerp.Lerp(functor, duration, self.__getBlend(blendType))
|
||||
self.functorFunc = functorFunc
|
||||
self.blendType = self.__getBlend(blendType)
|
||||
Interval.__init__(self, name, duration)
|
||||
|
||||
def setT(self, t, entry=0):
|
||||
""" setT(t)
|
||||
"""
|
||||
assert(t >= 0.0)
|
||||
if (entry == 1):
|
||||
self.lerp = Lerp.Lerp(self.functorFunc(), self.duration,
|
||||
self.blendType)
|
||||
if (entry == 1) and (t > self.duration):
|
||||
self.lerp.setT(self.duration)
|
||||
else:
|
||||
@ -50,6 +54,8 @@ class LerpPosHprInterval(LerpInterval):
|
||||
""" __init__(node, duration, pos, hpr, startPos, startHpr,
|
||||
other, blendType, name)
|
||||
"""
|
||||
def functorFunc(self=self, node=node, pos=pos, hpr=hpr,
|
||||
startPos=startPos, startHpr=startHpr, other=other):
|
||||
import PosHprLerpFunctor
|
||||
|
||||
assert(not node.isEmpty())
|
||||
@ -70,6 +76,7 @@ class LerpPosHprInterval(LerpInterval):
|
||||
functor = PosHprLerpFunctor.PosHprLerpFunctor(
|
||||
node, startPos, pos,
|
||||
startHpr, hpr)
|
||||
return functor
|
||||
|
||||
if (name == None):
|
||||
n = 'LerpPosHpr-%d' % self.lerpPosHprNum
|
||||
@ -77,7 +84,7 @@ class LerpPosHprInterval(LerpInterval):
|
||||
else:
|
||||
n = name
|
||||
|
||||
LerpInterval.__init__(self, n, duration, functor, blendType)
|
||||
LerpInterval.__init__(self, n, duration, functorFunc, blendType)
|
||||
|
||||
|
||||
class LerpPosInterval(LerpInterval):
|
||||
@ -88,6 +95,8 @@ class LerpPosInterval(LerpInterval):
|
||||
other=None, blendType='noBlend', name=None):
|
||||
""" __init__(node, duration, pos, startPos, other, blendType, name)
|
||||
"""
|
||||
def functorFunc(self=self, node=node, pos=pos, startPos=startPos,
|
||||
other=other):
|
||||
import PosLerpFunctor
|
||||
|
||||
assert(not node.isEmpty())
|
||||
@ -102,6 +111,7 @@ class LerpPosInterval(LerpInterval):
|
||||
startPos = node.getPos()
|
||||
functor = PosLerpFunctor.PosLerpFunctor(
|
||||
node, startPos, pos)
|
||||
return functor
|
||||
|
||||
if (name == None):
|
||||
n = 'LerpPos-%d' % self.lerpPosNum
|
||||
@ -109,7 +119,7 @@ class LerpPosInterval(LerpInterval):
|
||||
else:
|
||||
n = name
|
||||
|
||||
LerpInterval.__init__(self, n, duration, functor, blendType)
|
||||
LerpInterval.__init__(self, n, duration, functorFunc, blendType)
|
||||
|
||||
class LerpHprInterval(LerpInterval):
|
||||
|
||||
@ -119,6 +129,8 @@ class LerpHprInterval(LerpInterval):
|
||||
other=None, blendType='noBlend', name=None):
|
||||
""" __init__(node, duration, hpr, startHpr, other, blendType, name)
|
||||
"""
|
||||
def functorFunc(self=self, node=node, hpr=hpr, startHpr=startHpr,
|
||||
other=other):
|
||||
import HprLerpFunctor
|
||||
|
||||
assert(not node.isEmpty())
|
||||
@ -131,10 +143,9 @@ class LerpHprInterval(LerpInterval):
|
||||
else:
|
||||
if (startHpr == None):
|
||||
startHpr = node.getHpr()
|
||||
self.fhpr = startHpr
|
||||
self.thpr = hpr
|
||||
functor = HprLerpFunctor.HprLerpFunctor(
|
||||
node, startHpr, hpr)
|
||||
return functor
|
||||
|
||||
if (name == None):
|
||||
n = 'LerpHpr-%d' % self.lerpHprNum
|
||||
@ -142,4 +153,4 @@ class LerpHprInterval(LerpInterval):
|
||||
else:
|
||||
n = name
|
||||
|
||||
LerpInterval.__init__(self, n, duration, functor, blendType)
|
||||
LerpInterval.__init__(self, n, duration, functorFunc, blendType)
|
||||
|
Loading…
x
Reference in New Issue
Block a user