mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-04 10:54:24 -04:00
add getCurrentFrame, used in toontown vine game
This commit is contained in:
parent
1f31806e1d
commit
f4d998e214
@ -118,6 +118,18 @@ class ActorInterval(Interval.Interval):
|
|||||||
# Initialize superclass
|
# Initialize superclass
|
||||||
Interval.Interval.__init__(self, name, duration)
|
Interval.Interval.__init__(self, name, duration)
|
||||||
|
|
||||||
|
def getCurrentFrame(self):
|
||||||
|
"""Calculate the current frame playing in this interval.
|
||||||
|
|
||||||
|
returns a float value between startFrame and endFrame, inclusive
|
||||||
|
returns None if there are any problems
|
||||||
|
"""
|
||||||
|
retval = None
|
||||||
|
if not self.isStopped():
|
||||||
|
framesPlayed = self.numFrames * self.currT
|
||||||
|
retval = self.startFrame + framesPlayed
|
||||||
|
return retval
|
||||||
|
|
||||||
def privStep(self, t):
|
def privStep(self, t):
|
||||||
frameCount = t * self.frameRate
|
frameCount = t * self.frameRate
|
||||||
if self.constrainedLoop:
|
if self.constrainedLoop:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user