CMetaInterval
from panda3d.direct import CMetaInterval
- class CMetaInterval
Bases:
Bases:
CInterval
This interval contains a list of nested intervals, each of which has its own begin and end times. Some of them may overlap and some of them may not.
Inheritance diagram
-
enum DefType
-
enumerator DT_c_interval = 0
-
enumerator DT_ext_index = 1
-
enumerator DT_push_level = 2
-
enumerator DT_pop_level = 3
-
enumerator DT_c_interval = 0
-
enum RelativeStart
-
enumerator RS_previous_end = 0
-
enumerator RS_previous_begin = 1
-
enumerator RS_level_begin = 2
-
enumerator RS_previous_end = 0
- __init__(param0: CMetaInterval)
- __init__(name: str)
- addCInterval(c_interval: CInterval, rel_time: float, rel_to: RelativeStart) int
Adds a new
CInterval
to the list. The interval will be played when the indicated time (relative to the given point) has been reached.The return value is the index of the def entry representing the new interval.
- addExtIndex(ext_index: int, name: str, duration: float, open_ended: bool, rel_time: float, rel_to: RelativeStart) int
Adds a new external interval to the list. This represents some object in the external scripting language that has properties similar to a
CInterval
(for instance, a Python Interval object).The
CMetaInterval
object cannot play this external interval directly, but it records a placeholder for it and will ask the scripting language to play it when it is time, viaisEventReady()
and related methods.The ext_index number itself is simply a handle that the scripting language makes up and associates with its interval object somehow. The
CMetaInterval
object does not attempt to interpret this value.The return value is the index of the def entry representing the new interval.
- clearIntervals()
Resets the list of intervals and prepares for receiving a new list.
- getCInterval(n: int) CInterval
Return the
CInterval
pointer associated with the nth interval definition. It is only valid to call this if get_def_type(n) returns DT_c_interval.
- static getClassType() panda3d.core.TypeHandle
- getEventIndex() int
If a previous call to
isEventReady()
returned true, this returns the index number (added via add_event_index()) of the external interval that needs to be played.
- getEventT() float
If a previous call to
isEventReady()
returned true, this returns the t value that should be fed to the given interval.
- getEventType() EventType
If a previous call to
isEventReady()
returned true, this returns the type of the event (initialize, step, finalize, etc.) for the given interval.
- getExtIndex(n: int) int
Return the external interval index number associated with the nth interval definition. It is only valid to call this if get_def_type(n) returns DT_ext_index.
- getIntervalEndTime(name: str) float
Returns the actual end time, relative to the beginning of the interval, of the child interval with the given name, if found, or -1 if the interval is not found.
- getIntervalStartTime(name: str) float
Returns the actual start time, relative to the beginning of the interval, of the child interval with the given name, if found, or -1 if the interval is not found.
- getNumDefs() int
Returns the number of interval and push/pop definitions that have been added to the meta interval.
- getPrecision() float
Returns the precision with which time measurements are compared. See
setPrecision()
.
- isEventReady() bool
Returns true if a recent call to
privInitialize()
,privStep()
, orprivFinalize()
has left some external intervals ready to play. If this returns true, callgetEventIndex()
,getEventT()
, andpopEvent()
to retrieve the relevant information.
- popEvent()
Acknowledges that the external interval on the top of the queue has been extracted, and is about to be serviced by the scripting language. This prepares the interval so the next call to
isEventReady()
will return information about the next external interval on the queue, if any.
- popLevel(duration: float) int
Finishes a level marked by a previous call to
pushLevel()
, and returns to the previous level.If the duration is not negative, it represents a phony duration to assign to the level, for the purposes of sequencing later intervals. Otherwise, the level’s duration is computed based on the intervals within the level.
- pushLevel(name: str, rel_time: float, rel_to: RelativeStart) int
Marks the beginning of a nested level of child intervals. Within the nested level, a
RelativeStart
time of RS_level_begin refers to the start of the level, and the first interval added within the level is always relative to the start of the level.The return value is the index of the def entry created by this push.
- setIntervalStartTime(name: str, rel_time: float, rel_to: RelativeStart) bool
Adjusts the start time of the child interval with the given name, if found. This may be either a C++ interval added via
addCInterval()
, or an external interval added viaaddExtIndex()
; the name must match exactly.If the interval is found, its start time is adjusted, and all subsequent intervals are adjusting accordingly, and true is returned. If a matching interval is not found, nothing is changed and false is returned.
- setPrecision(precision: float)
Indicates the precision with which time measurements are compared. For numerical accuracy, all floating-point time values are converted to integer values internally by scaling by the precision factor. The larger the number given here, the smaller the delta of time that can be differentiated; the limit is the maximum integer that can be represented in the system.
- timeline(out: panda3d.core.ostream)
Outputs a list of all events in the order in which they occur.
-
enum DefType