14#ifndef ANIMINTERFACE_H
15#define ANIMINTERFACE_H
35class EXPCL_PANDA_PUTIL AnimInterface {
38 AnimInterface(
const AnimInterface ©);
41 virtual ~AnimInterface();
43 INLINE
void play(
double from,
double to);
44 INLINE
void loop(
bool restart);
45 INLINE
void loop(
bool restart,
double from,
double to);
47 INLINE
void pingpong(
bool restart,
double from,
double to);
49 INLINE
void pose(
double frame);
63 virtual void output(std::ostream &out)
const;
78 INLINE
void set_frame_rate(
double frame_rate);
79 INLINE
void set_num_frames(
int num_frames);
80 virtual void animation_activated();
95 class EXPCL_PANDA_PUTIL CData :
public CycleData {
98 CData(
const CData ©);
103 return AnimInterface::get_class_type();
106 void play(
double from,
double to);
107 void loop(
bool restart,
double from,
double to);
108 void pingpong(
bool restart,
double from,
double to);
109 void pose(
double frame);
111 INLINE
double get_frac()
const;
112 int get_full_frame(
int increment)
const;
113 double get_full_fframe()
const;
114 bool is_playing()
const;
116 virtual void output(std::ostream &out)
const;
118 void internal_set_rate(
double frame_rate,
double play_rate);
119 double get_f()
const;
131 double _effective_frame_rate;
136 PipelineCycler<CData> _cycler;
137 typedef CycleDataReader<CData> CDReader;
138 typedef CycleDataWriter<CData> CDWriter;
141 virtual void write_datagram(BamWriter *manager, Datagram &dg);
142 void fillin(DatagramIterator &scan, BamReader *manager);
145 static TypeHandle get_class_type() {
148 static void init_type() {
153 static TypeHandle _type_handle;
156INLINE std::ostream &operator << (std::ostream &out,
const AnimInterface &ai);
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
This is the fundamental interface for things that have a play/loop/stop type interface for frame-base...
void pose(double frame)
Sets the animation to the indicated frame and holds it there.
set_play_rate
Changes the rate at which the animation plays.
get_frame
Returns the current integer frame number.
is_playing
Returns true if the animation is currently playing, false if it is stopped (e.g.
get_num_frames
Returns the number of frames in the animation.
get_full_fframe
Returns the current floating-point frame number.
get_play_rate
Returns the rate at which the animation plays.
get_next_frame
Returns the current integer frame number + 1, constrained to the range 0 <= f < get_num_frames().
void stop()
Stops a currently playing or looping animation right where it is.
get_frame_rate
Returns the native frame rate of the animation.
void loop(bool restart)
Starts the entire animation looping.
get_frac
Returns the fractional part of the current frame.
void play()
Runs the entire animation from beginning to end and stops.
get_full_frame
Returns the current integer frame number.
void pingpong(bool restart)
Starts the entire animation bouncing back and forth between its first frame and last frame.
This is the fundamental interface for extracting binary objects from a Bam file, as generated by a Ba...
This is the fundamental interface for writing binary objects to a Bam file, to be extracted later by ...
A single page of data maintained by a PipelineCycler.
A class to retrieve the individual data elements previously stored in a Datagram.
An ordered list of data elements, formatted in memory for transmission over a socket or writing to a ...
TypeHandle is the identifier used to differentiate C++ class types.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void register_type(TypeHandle &type_handle, const std::string &name)
This inline function is just a convenient way to call TypeRegistry::register_type(),...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.