27template<
class SwitchType>
36 typedef typename SwitchType::ValueType ValueType;
42 virtual void get_value(
int frame, ValueType &value)=0;
46 virtual void get_scale(
int frame, LVecBase3 &scale);
47 virtual void get_hpr(
int frame, LVecBase3 &hpr);
48 virtual void get_quat(
int frame, LQuaternion &quat);
49 virtual void get_pos(
int frame, LVecBase3 &pos);
50 virtual void get_shear(
int frame, LVecBase3 &shear);
59 return get_class_type();
61 virtual TypeHandle force_init_type() {init_type();
return get_class_type();}
65 static void init_type() {
66 AnimChannelBase::init_type();
67 register_type(_type_handle, SwitchType::get_channel_type_name(),
68 AnimChannelBase::get_class_type());
80 typedef LMatrix4 ValueType;
81 static const char *get_channel_type_name() {
return "AnimChannelMatrix"; }
82 static const char *get_fixed_channel_type_name() {
return "AnimChannelFixed<LMatrix4>"; }
83 static const char *get_part_type_name() {
return "MovingPart<LMatrix4>"; }
84 static void output_value(std::ostream &out,
const ValueType &value);
86 static void write_datagram(
Datagram &dest, ValueType& me)
88 me.write_datagram(dest);
92 me.read_datagram(source);
102 typedef PN_stdfloat ValueType;
103 static const char *get_channel_type_name() {
return "AnimChannelScalar"; }
104 static const char *get_fixed_channel_type_name() {
return "AnimChannelScalarFixed"; }
105 static const char *get_part_type_name() {
return "MovingPart<PN_stdfloat>"; }
106 static void output_value(std::ostream &out, ValueType value) {
109 static void write_datagram(
Datagram &dest, ValueType& me)
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
Parent class for all animation channels.
This template class is the parent class for all kinds of AnimChannels that return different values.
virtual void get_scale(int frame, LVecBase3 &scale)
Returns the x, y, and z scale components associated with the current frame.
virtual void get_hpr(int frame, LVecBase3 &hpr)
Returns the h, p, and r components associated with the current frame.
virtual void get_quat(int frame, LQuaternion &quat)
Returns the rotation component associated with the current frame, expressed as a quaternion.
virtual TypeHandle get_value_type() const
Returns the TypeHandle associated with the ValueType we return.
virtual void get_pos(int frame, LVecBase3 &pos)
Returns the x, y, and z translation components associated with the current frame.
virtual void get_value_no_scale_shear(int frame, ValueType &value)
Returns the value associated with the current frame, with no scale or share components.
virtual void get_shear(int frame, LVecBase3 &shear)
Returns the a, b, and c shear components associated with the current frame.
This is the base class for AnimChannel and AnimBundle.
A class to retrieve the individual data elements previously stored in a Datagram.
PN_stdfloat get_stdfloat()
Extracts either a 32-bit or a 64-bit floating-point number, according to Datagram::set_stdfloat_doubl...
An ordered list of data elements, formatted in memory for transmission over a socket or writing to a ...
void add_stdfloat(PN_stdfloat value)
Adds either a 32-bit or a 64-bit floating-point number, according to set_stdfloat_double().
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.
void register_type(TypeHandle &type_handle, const std::string &name)
This inline function is just a convenient way to call TypeRegistry::register_type(),...