mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-04 10:54:24 -04:00
add update_to_now
This commit is contained in:
parent
e9210221b1
commit
86bda11d3b
@ -147,6 +147,21 @@ cull_callback(CullTraverser *, CullTraverserData &) {
|
|||||||
// the view frustum. We may need a better way to do this
|
// the view frustum. We may need a better way to do this
|
||||||
// optimization later, to handle characters that might animate
|
// optimization later, to handle characters that might animate
|
||||||
// themselves in front of the view frustum.
|
// themselves in front of the view frustum.
|
||||||
|
update_to_now();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////
|
||||||
|
// Function: Character::update_to_now
|
||||||
|
// Access: Public
|
||||||
|
// Description: Advances the character's frame to the current time,
|
||||||
|
// and then calls update(). This can be used by show
|
||||||
|
// code to force an update of the character's position
|
||||||
|
// to the current frame, regardless of whether the
|
||||||
|
// character is currently onscreen and animating.
|
||||||
|
////////////////////////////////////////////////////////////////////
|
||||||
|
void Character::
|
||||||
|
update_to_now() {
|
||||||
double now = ClockObject::get_global_clock()->get_frame_time();
|
double now = ClockObject::get_global_clock()->get_frame_time();
|
||||||
get_bundle()->advance_time(now);
|
get_bundle()->advance_time(now);
|
||||||
|
|
||||||
@ -155,7 +170,6 @@ cull_callback(CullTraverser *, CullTraverserData &) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
update();
|
update();
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
|
@ -61,6 +61,7 @@ PUBLISHED:
|
|||||||
INLINE void write_parts(ostream &out) const;
|
INLINE void write_parts(ostream &out) const;
|
||||||
INLINE void write_part_values(ostream &out) const;
|
INLINE void write_part_values(ostream &out) const;
|
||||||
|
|
||||||
|
void update_to_now();
|
||||||
void update();
|
void update();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user