コード例 #1
0
    def __init__(self, interval,
                 startT = 0, endT = None, playRate = 1,
                 duration = None, blendType = 'noBlend', name = None):
        self.interval = interval

        self.startAtStart = (startT == 0)
        self.endAtEnd = (endT == None or endT == interval.getDuration())
        
        if endT == None:
            endT = interval.getDuration()

        if duration == None:
            duration = abs(endT - startT) / playRate

        if (name == None):
            name = ('IndirectInterval-%d' %
                    IndirectInterval.indirectIntervalNum)
            IndirectInterval.indirectIntervalNum += 1

        self.startT = startT
        self.endT = endT
        self.deltaT = endT - startT
        self.blendType = LerpBlendHelpers.getBlend(blendType)

        Interval.Interval.__init__(self, name, duration)
コード例 #2
0
    def __init__(self, function, duration = 0.0, fromData = 0, toData = 1,
                 blendType = 'noBlend', extraArgs = [], name = None):
        """__init__(function, duration, fromData, toData, name)
        """
        # Record instance variables
        self.function = function
        self.fromData = fromData
        self.toData = toData
        self.blendType = LerpBlendHelpers.getBlend(blendType)
        self.extraArgs = extraArgs
        # Generate unique name if necessary
        if (name == None):
            name = ('LerpFunctionInterval-%s-%d' %
                    (function.__name__,
                     LerpFunctionInterval.lerpFunctionIntervalNum))
            LerpFunctionInterval.lerpFunctionIntervalNum += 1
        else:
            # Allow the user to pass in a %d in the name and we'll go ahead
            # and uniquify the name for them.
            if "%d" in name:
                name = name % LerpFunctionInterval.lerpFunctionIntervalNum
                LerpFunctionInterval.lerpFunctionIntervalNum += 1

        # Initialize superclass
        Interval.Interval.__init__(self, name, duration)
コード例 #3
0
ファイル: IndirectInterval.py プロジェクト: sempereon/panda3d
    def __init__(self,
                 interval,
                 startT=0,
                 endT=None,
                 playRate=1,
                 duration=None,
                 blendType='noBlend',
                 name=None):
        self.interval = interval

        self.startAtStart = (startT == 0)
        self.endAtEnd = (endT == None or endT == interval.getDuration())

        if endT == None:
            endT = interval.getDuration()

        if duration == None:
            duration = abs(endT - startT) / playRate

        if (name == None):
            name = ('IndirectInterval-%d' %
                    IndirectInterval.indirectIntervalNum)
            IndirectInterval.indirectIntervalNum += 1

        self.startT = startT
        self.endT = endT
        self.deltaT = endT - startT
        self.blendType = LerpBlendHelpers.getBlend(blendType)

        Interval.Interval.__init__(self, name, duration)
コード例 #4
0
    def __init__(self,
                 function,
                 duration=0.0,
                 fromData=0,
                 toData=1,
                 blendType='noBlend',
                 extraArgs=[],
                 name=None):
        """__init__(function, duration, fromData, toData, name)
        """
        # Record instance variables
        self.function = function
        self.fromData = fromData
        self.toData = toData
        self.blendType = LerpBlendHelpers.getBlend(blendType)
        self.extraArgs = extraArgs
        # Generate unique name if necessary
        if (name == None):
            name = ('LerpFunctionInterval-%s-%d' %
                    (function.__name__,
                     LerpFunctionInterval.lerpFunctionIntervalNum))
            LerpFunctionInterval.lerpFunctionIntervalNum += 1
        else:
            # Allow the user to pass in a %d in the name and we'll go ahead
            # and uniquify the name for them.
            if "%d" in name:
                name = name % LerpFunctionInterval.lerpFunctionIntervalNum
                LerpFunctionInterval.lerpFunctionIntervalNum += 1

        # Initialize superclass
        Interval.Interval.__init__(self, name, duration)
コード例 #5
0
 def __init__(self,
              function,
              duration=0.0,
              fromData=0,
              toData=1,
              blendType='noBlend',
              extraArgs=[],
              name=None):
     self.function = function
     self.fromData = fromData
     self.toData = toData
     self.blendType = LerpBlendHelpers.getBlend(blendType)
     self.extraArgs = extraArgs
     if name == None:
         name = 'LerpFunctionInterval-%d' % LerpFunctionNoStateInterval.lerpFunctionIntervalNum
         LerpFunctionNoStateInterval.lerpFunctionIntervalNum += 1
     else:
         if '%d' in name:
             name = name % LerpFunctionNoStateInterval.lerpFunctionIntervalNum
             LerpFunctionNoStateInterval.lerpFunctionIntervalNum += 1
     Interval.Interval.__init__(self, name, duration)
     return