Panda3D
|
An animation channel that accepts a matrix each frame from some dynamic input provided by code. More...
#include "animChannelMatrixDynamic.h"
Public Member Functions | |
AnimChannelMatrixDynamic (const string &name) | |
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 re-create this object and stores it in the appropiate place. | |
virtual TypeHandle | force_init_type () |
virtual void | get_hpr (int frame, LVecBase3 &hpr) |
Returns the h, p, and r components associated with the current frame. | |
virtual void | get_pos (int frame, LVecBase3 &pos) |
Returns the x, y, and z translation 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 void | get_scale (int frame, LVecBase3 &scale) |
Gets the scale value at the indicated frame. | |
virtual void | get_shear (int frame, LVecBase3 &shear) |
Returns the a, b, and c shear components associated with the current frame. | |
virtual TypeHandle | get_type () const |
virtual void | get_value (int frame, LMatrix4 &mat) |
Gets the value of the channel at the indicated frame. | |
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. | |
PandaNode * | get_value_node () const |
Returns the node that was set via set_value_node(), if any. | |
const TransformState * | get_value_transform () const |
Returns the explicit TransformState value that was set via set_value(), if any. | |
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(). | |
void | set_value (const LMatrix4 &value) |
Explicitly sets the matrix value. | |
void | set_value (const TransformState *value) |
Explicitly sets the matrix value, using the indicated TransformState object as a convenience. | |
void | set_value_node (PandaNode *node) |
Specifies a node whose transform will be queried each frame to implicitly specify the transform of this joint. | |
virtual void | write_datagram (BamWriter *manager, Datagram &dg) |
Function to write the important information in the particular object to a Datagram. | |
Static Public Member Functions | |
static TypeHandle | get_class_type () |
static void | init_type () |
static TypedWritable * | make_AnimChannelMatrixDynamic (const FactoryParams ¶ms) |
Factory method to generate an AnimChannelMatrixDynamic object. | |
static void | register_with_read_factory () |
Factory method to generate an AnimChannelMatrixDynamic object. | |
Protected Member Functions | |
AnimChannelMatrixDynamic () | |
For use only with the bam reader. | |
AnimChannelMatrixDynamic (AnimGroup *parent, const AnimChannelMatrixDynamic ©) | |
Creates a new AnimChannelMatrixDynamic, just like this one, without copying any children. | |
virtual AnimGroup * | make_copy (AnimGroup *parent) const |
Returns a copy of this object, and attaches it to the indicated parent (which may be NULL only if this is an AnimBundle). |
An animation channel that accepts a matrix each frame from some dynamic input provided by code.
This object operates in two modes: in explicit mode, the programmer should call set_value() each frame to indicate the new value; in implicit mode, the programmer should call set_value_node() to indicate the node whose transform will be copied to the joint each frame.
Definition at line 37 of file animChannelMatrixDynamic.h.
AnimChannelMatrixDynamic::AnimChannelMatrixDynamic | ( | ) | [protected] |
For use only with the bam reader.
Definition at line 34 of file animChannelMatrixDynamic.cxx.
Referenced by make_AnimChannelMatrixDynamic(), and make_copy().
AnimChannelMatrixDynamic::AnimChannelMatrixDynamic | ( | AnimGroup * | parent, |
const AnimChannelMatrixDynamic & | copy | ||
) | [protected] |
Creates a new AnimChannelMatrixDynamic, just like this one, without copying any children.
The new copy is added to the indicated parent. Intended to be called by make_copy() only.
Definition at line 46 of file animChannelMatrixDynamic.cxx.
int AnimChannelMatrixDynamic::complete_pointers | ( | TypedWritable ** | p_list, |
BamReader * | manager | ||
) | [virtual] |
Receives an array of pointers, one for each time manager->read_pointer() was called in fillin().
Returns the number of pointers processed.
Reimplemented from AnimGroup.
Definition at line 264 of file animChannelMatrixDynamic.cxx.
void AnimChannelMatrixDynamic::fillin | ( | DatagramIterator & | scan, |
BamReader * | manager | ||
) | [virtual] |
Function that reads out of the datagram (or asks manager to read) all of the data that is needed to re-create this object and stores it in the appropiate place.
Reimplemented from AnimChannelBase.
Definition at line 283 of file animChannelMatrixDynamic.cxx.
References BamReader::read_pointer().
Referenced by make_AnimChannelMatrixDynamic().
void AnimChannelMatrixDynamic::get_hpr | ( | int | frame, |
LVecBase3 & | hpr | ||
) | [virtual] |
Returns the h, p, and r components associated with the current frame.
As above, this only makes sense for a matrix-type channel.
Reimplemented from AnimChannel< ACMatrixSwitchType >.
Definition at line 139 of file animChannelMatrixDynamic.cxx.
void AnimChannelMatrixDynamic::get_pos | ( | int | frame, |
LVecBase3 & | pos | ||
) | [virtual] |
Returns the x, y, and z translation components associated with the current frame.
As above, this only makes sense for a matrix-type channel.
Reimplemented from AnimChannel< ACMatrixSwitchType >.
Definition at line 169 of file animChannelMatrixDynamic.cxx.
void AnimChannelMatrixDynamic::get_quat | ( | int | frame, |
LQuaternion & | quat | ||
) | [virtual] |
Returns the rotation component associated with the current frame, expressed as a quaternion.
As above, this only makes sense for a matrix-type channel.
Reimplemented from AnimChannel< ACMatrixSwitchType >.
Definition at line 154 of file animChannelMatrixDynamic.cxx.
void AnimChannelMatrixDynamic::get_scale | ( | int | frame, |
LVecBase3 & | scale | ||
) | [virtual] |
Gets the scale value at the indicated frame.
Reimplemented from AnimChannel< ACMatrixSwitchType >.
Definition at line 124 of file animChannelMatrixDynamic.cxx.
void AnimChannelMatrixDynamic::get_shear | ( | int | frame, |
LVecBase3 & | shear | ||
) | [virtual] |
Returns the a, b, and c shear components associated with the current frame.
As above, this only makes sense for a matrix-type channel.
Reimplemented from AnimChannel< ACMatrixSwitchType >.
Definition at line 184 of file animChannelMatrixDynamic.cxx.
void AnimChannelMatrixDynamic::get_value | ( | int | frame, |
LMatrix4 & | mat | ||
) | [virtual] |
Gets the value of the channel at the indicated frame.
Implements AnimChannel< ACMatrixSwitchType >.
Definition at line 92 of file animChannelMatrixDynamic.cxx.
void AnimChannelMatrixDynamic::get_value_no_scale_shear | ( | int | frame, |
LMatrix4 & | value | ||
) | [virtual] |
Gets the value of the channel at the indicated frame, without any scale or shear information.
Reimplemented from AnimChannel< ACMatrixSwitchType >.
Definition at line 106 of file animChannelMatrixDynamic.cxx.
PandaNode * AnimChannelMatrixDynamic::get_value_node | ( | ) | const [inline] |
Returns the node that was set via set_value_node(), if any.
Definition at line 35 of file animChannelMatrixDynamic.I.
const TransformState * AnimChannelMatrixDynamic::get_value_transform | ( | ) | const [inline] |
Returns the explicit TransformState value that was set via set_value(), if any.
Definition at line 24 of file animChannelMatrixDynamic.I.
bool AnimChannelMatrixDynamic::has_changed | ( | int | last_frame, |
double | last_frac, | ||
int | this_frame, | ||
double | this_frac | ||
) | [virtual] |
Returns true if the value has changed since the last call to has_changed().
last_frame is the frame number of the last call; this_frame is the current frame number.
Reimplemented from AnimChannelBase.
Definition at line 77 of file animChannelMatrixDynamic.cxx.
TypedWritable * AnimChannelMatrixDynamic::make_AnimChannelMatrixDynamic | ( | const FactoryParams & | params | ) | [static] |
Factory method to generate an AnimChannelMatrixDynamic object.
Definition at line 298 of file animChannelMatrixDynamic.cxx.
References AnimChannelMatrixDynamic(), and fillin().
Referenced by register_with_read_factory().
AnimGroup * AnimChannelMatrixDynamic::make_copy | ( | AnimGroup * | parent | ) | const [protected, virtual] |
Returns a copy of this object, and attaches it to the indicated parent (which may be NULL only if this is an AnimBundle).
Intended to be called by copy_subtree() only.
Reimplemented from AnimGroup.
Definition at line 238 of file animChannelMatrixDynamic.cxx.
References AnimChannelMatrixDynamic().
void AnimChannelMatrixDynamic::register_with_read_factory | ( | ) | [static] |
Factory method to generate an AnimChannelMatrixDynamic object.
Reimplemented from AnimGroup.
Definition at line 315 of file animChannelMatrixDynamic.cxx.
References BamReader::get_factory(), make_AnimChannelMatrixDynamic(), and Factory< Type >::register_factory().
void AnimChannelMatrixDynamic::set_value | ( | const LMatrix4 & | value | ) |
Explicitly sets the matrix value.
Definition at line 197 of file animChannelMatrixDynamic.cxx.
void AnimChannelMatrixDynamic::set_value | ( | const TransformState * | value | ) |
Explicitly sets the matrix value, using the indicated TransformState object as a convenience.
Definition at line 209 of file animChannelMatrixDynamic.cxx.
void AnimChannelMatrixDynamic::set_value_node | ( | PandaNode * | node | ) |
Specifies a node whose transform will be queried each frame to implicitly specify the transform of this joint.
Definition at line 222 of file animChannelMatrixDynamic.cxx.
References PandaNode::get_transform().
Referenced by MovingPartMatrix::apply_control().
void AnimChannelMatrixDynamic::write_datagram | ( | BamWriter * | manager, |
Datagram & | dg | ||
) | [virtual] |
Function to write the important information in the particular object to a Datagram.
Reimplemented from AnimChannelBase.
Definition at line 250 of file animChannelMatrixDynamic.cxx.
References BamWriter::write_pointer().