CIntervalManager
from panda3d.direct import CIntervalManager
- class CIntervalManager
Bases:
DTOOL_SUPER_BASE
This object holds a number of currently-playing intervals and is responsible for advancing them each frame as needed.
There is normally only one IntervalManager object in the world, and it is the responsibility of the scripting language to call step() on this object once each frame, and to then process the events indicated by get_next_event().
It is also possible to create multiple IntervalManager objects for special needs.
Inheritance diagram
- __init__(*args, **kwargs)
- addCInterval()
C++ Interface: add_c_interval(const CIntervalManager self, CInterval interval, bool external)
- /**
Adds the interval to the manager, and returns a unique index for the
interval. This index will be unique among all the currently added
intervals, but not unique across all intervals ever added to the manager.
The maximum index value will never exceed the maximum number of intervals
added at any given time.
If the external flag is true, the interval is understood to also be stored
in the scripting language data structures. In this case, it will be
available for information returned by get_next_event() and
get_next_removal(). If external is false, the interval’s index will never
be returned by these two functions.
*/
- add_c_interval()
C++ Interface: add_c_interval(const CIntervalManager self, CInterval interval, bool external)
- /**
Adds the interval to the manager, and returns a unique index for the
interval. This index will be unique among all the currently added
intervals, but not unique across all intervals ever added to the manager.
The maximum index value will never exceed the maximum number of intervals
added at any given time.
If the external flag is true, the interval is understood to also be stored
in the scripting language data structures. In this case, it will be
available for information returned by get_next_event() and
get_next_removal(). If external is false, the interval’s index will never
be returned by these two functions.
*/
- findCInterval()
C++ Interface: find_c_interval(CIntervalManager self, str name)
- /**
Returns the index associated with the named interval, if there is such an
interval, or -1 if there is not.
*/
- find_c_interval()
C++ Interface: find_c_interval(CIntervalManager self, str name)
- /**
Returns the index associated with the named interval, if there is such an
interval, or -1 if there is not.
*/
- getCInterval()
C++ Interface: get_c_interval(CIntervalManager self, int index)
- /**
Returns the interval associated with the given index.
*/
- getEventQueue()
C++ Interface: get_event_queue(CIntervalManager self)
- /**
Returns the custom event queue to be used for throwing done events from
intervals as they finish.
*/
- getGlobalPtr()
C++ Interface: get_global_ptr()
- /**
Returns the pointer to the one global CIntervalManager object.
*/
- getMaxIndex()
C++ Interface: get_max_index(CIntervalManager self)
- /**
Returns one more than the largest interval index number in the manager. If
you walk through all the values between (0, get_max_index()] and call
get_c_interval() on each number, you will retrieve all of the managed
intervals (and possibly a number of NULL pointers as well).
*/
- getNextEvent()
C++ Interface: get_next_event(const CIntervalManager self)
- /**
This should be called by the scripting language after each call to step().
It returns the index number of the next interval that has events requiring
servicing by the scripting language, or -1 if no more intervals have any
events pending.
If this function returns something other than -1, it is the scripting
language’s responsibility to query the indicated interval for its next
event via get_event_index(), and eventually pop_event().
Then get_next_event() should be called again until it returns -1.
*/
- getNextRemoval()
C++ Interface: get_next_removal(const CIntervalManager self)
- /**
This should be called by the scripting language after each call to step().
It returns the index number of an interval that was recently removed, or -1
if no intervals were removed.
If this returns something other than -1, the scripting language should
clean up its own data structures accordingly, and then call
get_next_removal() again.
*/
- getNumIntervals()
C++ Interface: get_num_intervals(CIntervalManager self)
- /**
Returns the number of currently active intervals.
*/
- get_c_interval()
C++ Interface: get_c_interval(CIntervalManager self, int index)
- /**
Returns the interval associated with the given index.
*/
- get_event_queue()
C++ Interface: get_event_queue(CIntervalManager self)
- /**
Returns the custom event queue to be used for throwing done events from
intervals as they finish.
*/
- get_global_ptr()
C++ Interface: get_global_ptr()
- /**
Returns the pointer to the one global CIntervalManager object.
*/
- get_max_index()
C++ Interface: get_max_index(CIntervalManager self)
- /**
Returns one more than the largest interval index number in the manager. If
you walk through all the values between (0, get_max_index()] and call
get_c_interval() on each number, you will retrieve all of the managed
intervals (and possibly a number of NULL pointers as well).
*/
- get_next_event()
C++ Interface: get_next_event(const CIntervalManager self)
- /**
This should be called by the scripting language after each call to step().
It returns the index number of the next interval that has events requiring
servicing by the scripting language, or -1 if no more intervals have any
events pending.
If this function returns something other than -1, it is the scripting
language’s responsibility to query the indicated interval for its next
event via get_event_index(), and eventually pop_event().
Then get_next_event() should be called again until it returns -1.
*/
- get_next_removal()
C++ Interface: get_next_removal(const CIntervalManager self)
- /**
This should be called by the scripting language after each call to step().
It returns the index number of an interval that was recently removed, or -1
if no intervals were removed.
If this returns something other than -1, the scripting language should
clean up its own data structures accordingly, and then call
get_next_removal() again.
*/
- get_num_intervals()
C++ Interface: get_num_intervals(CIntervalManager self)
- /**
Returns the number of currently active intervals.
*/
- interrupt()
C++ Interface: interrupt(const CIntervalManager self)
- /**
Pauses or finishes (removes from the active queue) all intervals tagged
with auto_pause or auto_finish set to true. These are intervals that
someone fired up but won’t necessarily expect to clean up; they can be
interrupted at will when necessary.
Returns the number of intervals affected.
*/
- removeCInterval()
C++ Interface: remove_c_interval(const CIntervalManager self, int index)
- /**
Removes the indicated interval from the queue immediately. It will not be
returned from get_next_removal(), and none of its pending events, if any,
will be returned by get_next_event().
*/
- remove_c_interval()
C++ Interface: remove_c_interval(const CIntervalManager self, int index)
- /**
Removes the indicated interval from the queue immediately. It will not be
returned from get_next_removal(), and none of its pending events, if any,
will be returned by get_next_event().
*/
- setEventQueue()
C++ Interface: set_event_queue(const CIntervalManager self, EventQueue event_queue)
- /**
Specifies a custom event queue to be used for throwing done events from
intervals as they finish. If this is not specified, the global event queue
is used.
The caller maintains ownership of the EventQueue object; it is the caller’s
responsibility to ensure that the supplied EventQueue does not destruct
during the lifetime of the CIntervalManager.
*/
- set_event_queue()
C++ Interface: set_event_queue(const CIntervalManager self, EventQueue event_queue)
- /**
Specifies a custom event queue to be used for throwing done events from
intervals as they finish. If this is not specified, the global event queue
is used.
The caller maintains ownership of the EventQueue object; it is the caller’s
responsibility to ensure that the supplied EventQueue does not destruct
during the lifetime of the CIntervalManager.
*/
- step()
C++ Interface: step(const CIntervalManager self)
- /**
This should be called every frame to do the processing for all the active
intervals. It will call step_play() for each interval that has been added
and that has not yet been removed.
After each call to step(), the scripting language should call
get_next_event() and get_next_removal() repeatedly to process all the high-
level (e.g. Python-interval-based) events and to manage the high-level
list of intervals.
*/