15 #include "animChannelMatrixDynamic.h" 16 #include "animBundle.h" 17 #include "config_chan.h" 19 #include "compose_matrix.h" 22 #include "datagramIterator.h" 23 #include "bamReader.h" 24 #include "bamWriter.h" 26 TypeHandle AnimChannelMatrixDynamic::_type_handle;
33 AnimChannelMatrixDynamic::
34 AnimChannelMatrixDynamic() {
45 AnimChannelMatrixDynamic::
48 _value_node(copy._value_node),
59 AnimChannelMatrixDynamic::
60 AnimChannelMatrixDynamic(
const string &name)
63 _value = TransformState::make_identity();
79 _value = _value_node->get_transform();
94 _value = _value_node->get_transform();
96 mat = _value->get_mat();
108 _value = _value_node->get_transform();
110 if (_value->has_scale() || _value->has_shear()) {
111 compose_matrix(mat,
LVecBase3(1.0f, 1.0f, 1.0f),
112 _value->get_hpr(), _value->get_pos());
114 mat = _value->get_mat();
126 _value = _value_node->get_transform();
128 scale = _value->get_scale();
141 _value = _value_node->get_transform();
143 hpr = _value->get_hpr();
156 _value = _value_node->get_transform();
158 quat = _value->get_quat();
171 _value = _value_node->get_transform();
173 pos = _value->get_pos();
186 _value = _value_node->get_transform();
188 shear = _value->get_shear();
198 _value = TransformState::make_mat(value);
223 _value_node = value_node;
225 _value = _value_node->get_transform();
268 _value_node = DCAST(
PandaNode, p_list[pi++]);
269 _value = DCAST(TransformState, p_list[pi++]);
284 AnimChannelMatrix::fillin(scan, manager);
303 parse_params(params, scan, manager);
304 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.
static void register_with_read_factory()
Factory method to generate an AnimChannelMatrixDynamic object.
virtual void get_scale(int frame, LVecBase3 &scale)
Gets the scale value at the indicated frame.
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...
Base class for objects that can be written to and read from Bam files.
virtual void get_value(int frame, LMatrix4 &mat)
Gets the value of the channel at the indicated frame.
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 ...
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().
An animation channel that accepts a matrix each frame from some dynamic input provided by code...
This is the base class for AnimChannel and AnimBundle.
virtual void get_shear(int frame, LVecBase3 &shear)
Returns the a, b, and c shear components associated with the current frame.
This is a 4-by-4 transform matrix.
virtual void get_quat(int frame, LQuaternion &quat)
Returns the rotation component associated with the current frame, expressed as a quaternion.
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.
static TypedWritable * make_AnimChannelMatrixDynamic(const FactoryParams ¶ms)
Factory method to generate an AnimChannelMatrixDynamic object.
void register_factory(TypeHandle handle, CreateFunc *func)
Registers a new kind of thing the Factory will be able to create.
static WritableFactory * get_factory()
Returns the global WritableFactory for generating TypedWritable objects.
virtual void get_hpr(int frame, LVecBase3 &hpr)
Returns the h, p, and r components associated with the current frame.
This is the base quaternion class.
A class to retrieve the individual data elements previously stored in a Datagram. ...
virtual int complete_pointers(TypedWritable **plist, BamReader *manager)
Receives an array of pointers, one for each time manager->read_pointer() was called in fillin()...
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...
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 ...
virtual void write_datagram(BamWriter *manager, Datagram &dg)
Function to write the important information in the particular object to a Datagram.
virtual void get_pos(int frame, LVecBase3 &pos)
Returns the x, y, and z translation components associated with the current frame. ...
void write_pointer(Datagram &packet, const TypedWritable *dest)
The interface for writing a pointer to another object to a Bam file.
void set_value(const LMatrix4 &value)
Explicitly sets the matrix value.
void read_pointer(DatagramIterator &scan)
The interface for reading a pointer to another object from a Bam file.
virtual void get_value_no_scale_shear(int frame, LMatrix4 &value)
Gets the value of the channel at the indicated frame, without any scale or shear information.