24 _precision = precision;
43 return (
int)_defs.size();
51 nassertr(n >= 0 && n < (
int)_defs.size(), DT_c_interval);
52 return _defs[n]._type;
61 nassertr(n >= 0 && n < (
int)_defs.size(),
nullptr);
62 nassertr(_defs[n]._type == DT_c_interval,
nullptr);
63 return _defs[n]._c_interval;
73 nassertr(n >= 0 && n < (
int)_defs.size(), -1);
74 nassertr(_defs[n]._type == DT_ext_index, -1);
75 return _defs[n]._ext_index;
86 return service_event_queue();
96 nassertr(!_event_queue.empty(), -1);
97 const EventQueueEntry &entry = _event_queue.front();
98 const IntervalDef &def = _defs[entry._n];
99 nassertr(def._type == DT_ext_index, -1);
100 return def._ext_index;
109 nassertr(!_event_queue.empty(), 0.0f);
110 return int_to_double_time(_event_queue.front()._time);
119 nassertr(!_event_queue.empty(), ET_step);
120 return _event_queue.front()._event_type;
127 INLINE
int CMetaInterval::
128 double_to_int_time(
double t)
const {
130 return (
int)floor(t * _precision + 0.5);
137 INLINE
double CMetaInterval::
138 int_to_double_time(
int time)
const {
139 return (
double)time / _precision;
145 INLINE CMetaInterval::PlaybackEvent::
146 PlaybackEvent(
int time,
int n,
147 CMetaInterval::PlaybackEventType type) :
158 INLINE
bool CMetaInterval::PlaybackEvent::
159 operator < (
const CMetaInterval::PlaybackEvent &other)
const {
160 return _time < other._time;
166 INLINE CMetaInterval::EventQueueEntry::
167 EventQueueEntry(
int n, CInterval::EventType event_type,
int time) :
169 _event_type(event_type),
The base class for timeline components.
void mark_dirty()
Called by a derived class to indicate the interval has been changed internally and must be recomputed...