CMetaInterval

from panda3d.direct import CMetaInterval
class CMetaInterval

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

Inheritance diagram of CMetaInterval

DTCInterval = 0
DTExtIndex = 1
DTPopLevel = 3
DTPushLevel = 2
DT_c_interval = 0
DT_ext_index = 1
DT_pop_level = 3
DT_push_level = 2
RSLevelBegin = 2
RSPreviousBegin = 1
RSPreviousEnd = 0
RS_level_begin = 2
RS_previous_begin = 1
RS_previous_end = 0
__init__(*args, **kwargs)
addCInterval()

C++ Interface: add_c_interval(const CMetaInterval self, CInterval c_interval, double rel_time, int rel_to)

/**
  • 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()

C++ Interface: add_ext_index(const CMetaInterval self, int ext_index, str name, double duration, bool open_ended, double rel_time, int rel_to)

/**
  • 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, via is_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.

*/

add_c_interval()

C++ Interface: add_c_interval(const CMetaInterval self, CInterval c_interval, double rel_time, int rel_to)

/**
  • 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()

C++ Interface: add_ext_index(const CMetaInterval self, int ext_index, str name, double duration, bool open_ended, double rel_time, int rel_to)

/**
  • 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, via is_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.

*/

clearIntervals()

C++ Interface: clear_intervals(const CMetaInterval self)

/**
  • Resets the list of intervals and prepares for receiving a new list.

*/

clear_intervals()

C++ Interface: clear_intervals(const CMetaInterval self)

/**
  • Resets the list of intervals and prepares for receiving a new list.

*/

getCInterval()

C++ Interface: get_c_interval(CMetaInterval self, int n)

/**
  • 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.

*/

getClassType()

C++ Interface: get_class_type()

getDefType()

C++ Interface: get_def_type(CMetaInterval self, int n)

/**
  • Returns the type of the nth interval definition that has been added.

*/

getEventIndex()

C++ Interface: get_event_index(CMetaInterval self)

/**
  • 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.

*/

getEventT()

C++ Interface: get_event_t(CMetaInterval self)

/**
  • If a previous call to is_event_ready() returned true, this returns the t

  • value that should be fed to the given interval.

*/

getEventType()

C++ Interface: get_event_type(CMetaInterval self)

/**
  • 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.

*/

getExtIndex()

C++ Interface: get_ext_index(CMetaInterval self, int n)

/**
  • 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()

C++ Interface: get_interval_end_time(CMetaInterval self, str name)

/**
  • 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()

C++ Interface: get_interval_start_time(CMetaInterval self, str name)

/**
  • 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()

C++ Interface: get_num_defs(CMetaInterval self)

/**
  • Returns the number of interval and push/pop definitions that have been

  • added to the meta interval.

*/

getPrecision()

C++ Interface: get_precision(CMetaInterval self)

/**
  • Returns the precision with which time measurements are compared. See

  • set_precision().

*/

get_c_interval()

C++ Interface: get_c_interval(CMetaInterval self, int n)

/**
  • 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.

*/

get_class_type()

C++ Interface: get_class_type()

get_def_type()

C++ Interface: get_def_type(CMetaInterval self, int n)

/**
  • Returns the type of the nth interval definition that has been added.

*/

get_event_index()

C++ Interface: get_event_index(CMetaInterval self)

/**
  • 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()

C++ Interface: get_event_t(CMetaInterval self)

/**
  • 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()

C++ Interface: get_event_type(CMetaInterval self)

/**
  • 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()

C++ Interface: get_ext_index(CMetaInterval self, int n)

/**
  • 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()

C++ Interface: get_interval_end_time(CMetaInterval self, str name)

/**
  • 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()

C++ Interface: get_interval_start_time(CMetaInterval self, str name)

/**
  • 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()

C++ Interface: get_num_defs(CMetaInterval self)

/**
  • Returns the number of interval and push/pop definitions that have been

  • added to the meta interval.

*/

get_precision()

C++ Interface: get_precision(CMetaInterval self)

/**
  • Returns the precision with which time measurements are compared. See

  • set_precision().

*/

isEventReady()

C++ Interface: is_event_ready(const CMetaInterval self)

/**
  • Returns true if a recent call to priv_initialize(), priv_step(), or

  • priv_finalize() has left some external intervals ready to play. If this

  • returns true, call get_event_index(), get_event_t(), and pop_event() to

  • retrieve the relevant information.

*/

is_event_ready()

C++ Interface: is_event_ready(const CMetaInterval self)

/**
  • Returns true if a recent call to priv_initialize(), priv_step(), or

  • priv_finalize() has left some external intervals ready to play. If this

  • returns true, call get_event_index(), get_event_t(), and pop_event() to

  • retrieve the relevant information.

*/

popEvent()

C++ Interface: pop_event(const CMetaInterval self)

/**
  • 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.

*/

popLevel()

C++ Interface: pop_level(const CMetaInterval self, double duration)

/**
  • 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.

*/

pop_event()

C++ Interface: pop_event(const CMetaInterval self)

/**
  • 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()

C++ Interface: pop_level(const CMetaInterval self, double duration)

/**
  • 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.

*/

pushLevel()

C++ Interface: push_level(const CMetaInterval self, str name, double rel_time, int rel_to)

/**
  • 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.

*/

push_level()

C++ Interface: push_level(const CMetaInterval self, str name, double rel_time, int rel_to)

/**
  • 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()

C++ Interface: set_interval_start_time(const CMetaInterval self, str name, double rel_time, int rel_to)

/**
  • 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 via add_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.

*/

setPrecision()

C++ Interface: set_precision(const CMetaInterval self, double precision)

/**
  • 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.

*/

set_interval_start_time()

C++ Interface: set_interval_start_time(const CMetaInterval self, str name, double rel_time, int rel_to)

/**
  • 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 via add_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()

C++ Interface: set_precision(const CMetaInterval self, double precision)

/**
  • 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()

C++ Interface: timeline(CMetaInterval self, ostream out)

/**
  • Outputs a list of all events in the order in which they occur.

*/