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)
- add_c_interval(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.
- add_ext_index(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, viais_event_ready()
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.
- clear_intervals()
Resets the list of intervals and prepares for receiving a new list.
- get_c_interval(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 get_class_type() panda3d.core.TypeHandle
- get_event_index() int
If a previous call to
is_event_ready()
returned true, this returns the index number (added via add_event_index()) of the external interval that needs to be played.
- get_event_t() float
If a previous call to
is_event_ready()
returned true, this returns the t value that should be fed to the given interval.
- get_event_type() EventType
If a previous call to
is_event_ready()
returned true, this returns the type of the event (initialize, step, finalize, etc.) for the given interval.
- get_ext_index(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.
- get_interval_end_time(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.
- get_interval_start_time(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.
- get_num_defs() int
Returns the number of interval and push/pop definitions that have been added to the meta interval.
- get_precision() float
Returns the precision with which time measurements are compared. See
set_precision()
.
- is_event_ready() bool
Returns true if a recent call to
priv_initialize()
,priv_step()
, orpriv_finalize()
has left some external intervals ready to play. If this returns true, callget_event_index()
,get_event_t()
, andpop_event()
to retrieve the relevant information.
- pop_event()
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
is_event_ready()
will return information about the next external interval on the queue, if any.
- pop_level(duration: float) int
Finishes a level marked by a previous call to
push_level()
, 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.
- push_level(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.
- set_interval_start_time(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
add_c_interval()
, or an external interval added viaadd_ext_index()
; 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.
- set_precision(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