25 TypeHandle AnimChannelScalarDynamic::_type_handle;
30 AnimChannelScalarDynamic::
31 AnimChannelScalarDynamic() {
39 AnimChannelScalarDynamic::
42 _value_node(copy._value_node),
46 _float_value(copy._float_value)
53 AnimChannelScalarDynamic::
54 AnimChannelScalarDynamic(
const std::string &name)
57 _last_value = _value = TransformState::make_identity();
58 _value_changed =
true;
69 if (_value_node !=
nullptr) {
70 _value = _value_node->get_transform();
77 _value_changed =
false;
85 void AnimChannelScalarDynamic::
86 get_value(
int, PN_stdfloat &value) {
98 _value_changed =
true;
108 if (_value_node ==
nullptr) {
109 _last_value = TransformState::make_pos(LVecBase3(_float_value, 0.0f, 0.0f));
112 _value_node = value_node;
114 if (_value_node !=
nullptr) {
115 _value = _value_node->get_transform();
151 _value_node = DCAST(
PandaNode, p_list[pi++]);
164 AnimChannelScalar::fillin(scan, manager);
183 me->
fillin(scan, manager);
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
A basic node of the scene graph or data graph.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
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...
set_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.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
This is the fundamental interface for writing binary objects to a Bam file, to be extracted later by ...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
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 parse_params(const FactoryParams ¶ms, DatagramIterator &scan, BamReader *&manager)
Takes in a FactoryParams, passed from a WritableFactory into any TypedWritable's make function,...
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().
set_value_node
Specifies a node whose transform will be queried each frame to implicitly specify the transform of th...
An instance of this class is passed to the Factory when requesting it to do its business and construc...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void register_factory(TypeHandle handle, CreateFunc *func, void *user_data=nullptr)
Registers a new kind of thing the Factory will be able to create.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
virtual void write_datagram(BamWriter *manager, Datagram &me)
Function to write the important information in the particular object to a Datagram.
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.
bool read_pointer(DatagramIterator &scan)
The interface for reading a pointer to another object from a Bam file.
A class to retrieve the individual data elements previously stored in a Datagram.
TypeHandle is the identifier used to differentiate C++ class types.
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.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void write_pointer(Datagram &packet, const TypedWritable *dest)
The interface for writing a pointer to another object to a Bam file.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.