mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 10:22:45 -04:00
define sync_frame_time
This commit is contained in:
parent
222845f50b
commit
aee3bf8fae
@ -136,6 +136,27 @@ tick() {
|
|||||||
_frame_count++;
|
_frame_count++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////
|
||||||
|
// Function: ClockObject::sync_frame_time
|
||||||
|
// Access: Published
|
||||||
|
// Description: Resets the frame time to the current real time. This
|
||||||
|
// is similar to tick(), except that it does not advance
|
||||||
|
// the frame counter and does not affect dt. This is
|
||||||
|
// intended to be used in the middle of a particularly
|
||||||
|
// long frame to compensate for the time that has
|
||||||
|
// already elapsed.
|
||||||
|
//
|
||||||
|
// In non-real-time mode, this function has no effect
|
||||||
|
// (because in this mode all frames take the same length
|
||||||
|
// of time).
|
||||||
|
////////////////////////////////////////////////////////////////////
|
||||||
|
void ClockObject::
|
||||||
|
sync_frame_time() {
|
||||||
|
if (_mode == M_normal) {
|
||||||
|
_reported_frame_time = get_real_time();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
// Function: get_time_of_day
|
// Function: get_time_of_day
|
||||||
// Description:
|
// Description:
|
||||||
|
@ -95,6 +95,7 @@ PUBLISHED:
|
|||||||
INLINE void set_max_dt(double max_dt);
|
INLINE void set_max_dt(double max_dt);
|
||||||
|
|
||||||
void tick();
|
void tick();
|
||||||
|
void sync_frame_time();
|
||||||
|
|
||||||
INLINE static ClockObject *get_global_clock();
|
INLINE static ClockObject *get_global_clock();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user