mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-04 02:42:49 -04:00
allow intervals with duration < 0
This commit is contained in:
parent
87636fa232
commit
dea5eaccfb
@ -19,7 +19,7 @@ class Interval(DirectObject):
|
|||||||
"""__init__(name, duration, openEnded)
|
"""__init__(name, duration, openEnded)
|
||||||
"""
|
"""
|
||||||
self.name = name
|
self.name = name
|
||||||
self.duration = duration
|
self.duration = max(duration, 0.0)
|
||||||
self.state = CInterval.SInitial
|
self.state = CInterval.SInitial
|
||||||
self.currT = 0.0
|
self.currT = 0.0
|
||||||
self.doneEvent = None
|
self.doneEvent = None
|
||||||
@ -37,8 +37,6 @@ class Interval(DirectObject):
|
|||||||
# if it should be ignored in this case.
|
# if it should be ignored in this case.
|
||||||
self.openEnded = openEnded
|
self.openEnded = openEnded
|
||||||
|
|
||||||
assert(self.duration >= 0)
|
|
||||||
|
|
||||||
def getName(self):
|
def getName(self):
|
||||||
return self.name
|
return self.name
|
||||||
|
|
||||||
|
@ -36,7 +36,7 @@ CInterval(const string &name, double duration, bool open_ended) :
|
|||||||
_state(S_initial),
|
_state(S_initial),
|
||||||
_curr_t(0.0),
|
_curr_t(0.0),
|
||||||
_name(name),
|
_name(name),
|
||||||
_duration(duration),
|
_duration(max(duration, 0.0)),
|
||||||
_open_ended(open_ended),
|
_open_ended(open_ended),
|
||||||
_dirty(false)
|
_dirty(false)
|
||||||
{
|
{
|
||||||
@ -53,7 +53,6 @@ CInterval(const string &name, double duration, bool open_ended) :
|
|||||||
_play_rate = 1.0;
|
_play_rate = 1.0;
|
||||||
_do_loop = false;
|
_do_loop = false;
|
||||||
_loop_count = 0;
|
_loop_count = 0;
|
||||||
nassertv(_duration >= 0.0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
|
Loading…
x
Reference in New Issue
Block a user