15 #include "animChannelScalarDynamic.h" 16 #include "animBundle.h" 17 #include "config_chan.h" 18 #include "transformState.h" 19 #include "pandaNode.h" 22 #include "datagramIterator.h" 23 #include "bamReader.h" 24 #include "bamWriter.h" 26 TypeHandle AnimChannelScalarDynamic::_type_handle;
33 AnimChannelScalarDynamic::
34 AnimChannelScalarDynamic() {
45 AnimChannelScalarDynamic::
48 _value_node(copy._value_node),
52 _float_value(copy._float_value)
61 AnimChannelScalarDynamic::
62 AnimChannelScalarDynamic(
const string &name)
65 _last_value = _value = TransformState::make_identity();
66 _value_changed =
true;
81 _value = _value_node->get_transform();
88 _value_changed =
false;
101 value = _value->get_pos()[0];
104 value = _float_value;
115 _float_value = value;
117 _value_changed =
true;
130 _last_value = TransformState::make_pos(
LVecBase3(_float_value, 0.0f, 0.0f));
133 _value_node = value_node;
136 _value = _value_node->get_transform();
180 _value_node = DCAST(
PandaNode, p_list[pi++]);
181 _value = DCAST(TransformState, p_list[pi++]);
196 AnimChannelScalar::fillin(scan, manager);
216 parse_params(params, scan, manager);
217 me->
fillin(scan, manager);
A basic node of the scene graph or data graph.
This is the base class for all three-component vectors and points.
PN_stdfloat get_stdfloat()
Extracts either a 32-bit or a 64-bit floating-point number, according to Datagram::set_stdfloat_doubl...
virtual int complete_pointers(TypedWritable **p_list, BamReader *manager)
Takes in a vector of pointes to TypedWritable objects that correspond to all the requests for pointer...
This is the fundamental interface for extracting binary objects from a Bam file, as generated by a Ba...
void set_value(PN_stdfloat value)
Explicitly sets the value.
virtual bool has_changed(int last_frame, double last_frac, int this_frame, double this_frac)
Returns true if the value has changed since the last call to has_changed().
Base class for objects that can be written to and read from Bam files.
void set_value_node(PandaNode *node)
Specifies a node whose transform will be queried each frame to implicitly specify the transform of th...
This is the fundamental interface for writing binary objects to a Bam file, to be extracted later by ...
This template class is the parent class for all kinds of AnimChannels that return different values...
virtual void write_datagram(BamWriter *manager, Datagram &dg)
Function to write the important information in the particular object to a Datagram.
static void register_with_read_factory()
Factory method to generate a AnimChannelScalarDynamic object.
void add_stdfloat(PN_stdfloat value)
Adds either a 32-bit or a 64-bit floating-point number, according to set_stdfloat_double().
void fillin(DatagramIterator &scan, BamReader *manager)
Function that reads out of the datagram (or asks manager to read) all of the data that is needed to r...
This is the base class for AnimChannel and AnimBundle.
virtual int complete_pointers(TypedWritable **plist, BamReader *manager)
Receives an array of pointers, one for each time manager->read_pointer() was called in fillin()...
An instance of this class is passed to the Factory when requesting it to do its business and construc...
virtual void write_datagram(BamWriter *manager, Datagram &me)
Function to write the important information in the particular object to a Datagram.
void register_factory(TypeHandle handle, CreateFunc *func)
Registers a new kind of thing the Factory will be able to create.
An animation channel that accepts a scalar each frame from some dynamic input provided by code...
static WritableFactory * get_factory()
Returns the global WritableFactory for generating TypedWritable objects.
A class to retrieve the individual data elements previously stored in a Datagram. ...
TypeHandle is the identifier used to differentiate C++ class types.
virtual void get_value(int frame, PN_stdfloat &value)
Gets the value of the channel at the indicated frame.
An ordered list of data elements, formatted in memory for transmission over a socket or writing to a ...
static TypedWritable * make_AnimChannelScalarDynamic(const FactoryParams ¶ms)
Factory method to generate a AnimChannelScalarDynamic object.
void write_pointer(Datagram &packet, const TypedWritable *dest)
The interface for writing a pointer to another object to a Bam file.
void read_pointer(DatagramIterator &scan)
The interface for reading a pointer to another object from a Bam file.