Panda3D
|
An animation channel that accepts a scalar each frame from some dynamic input provided by code. More...
#include "animChannelScalarDynamic.h"
Public Member Functions | |
AnimChannelScalarDynamic (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 TypeHandle | get_type () const |
virtual void | get_value (int frame, PN_stdfloat &value) |
Gets the value of the channel at the indicated frame. | |
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 (PN_stdfloat value) |
Explicitly sets the value. | |
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_AnimChannelScalarDynamic (const FactoryParams ¶ms) |
Factory method to generate a AnimChannelScalarDynamic object. | |
static void | register_with_read_factory () |
Factory method to generate a AnimChannelScalarDynamic object. | |
Protected Member Functions | |
AnimChannelScalarDynamic () | |
For use only with the bam reader. | |
AnimChannelScalarDynamic (AnimGroup *parent, const AnimChannelScalarDynamic ©) | |
Creates a new AnimChannelScalarDynamic, 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 scalar 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 X component will be copied to the scalar each frame.
Definition at line 37 of file animChannelScalarDynamic.h.
AnimChannelScalarDynamic::AnimChannelScalarDynamic | ( | ) | [protected] |
For use only with the bam reader.
Definition at line 34 of file animChannelScalarDynamic.cxx.
Referenced by make_AnimChannelScalarDynamic(), and make_copy().
AnimChannelScalarDynamic::AnimChannelScalarDynamic | ( | AnimGroup * | parent, |
const AnimChannelScalarDynamic & | copy | ||
) | [protected] |
Creates a new AnimChannelScalarDynamic, 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 animChannelScalarDynamic.cxx.
int AnimChannelScalarDynamic::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 176 of file animChannelScalarDynamic.cxx.
void AnimChannelScalarDynamic::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 195 of file animChannelScalarDynamic.cxx.
References DatagramIterator::get_stdfloat(), and BamReader::read_pointer().
Referenced by make_AnimChannelScalarDynamic().
void AnimChannelScalarDynamic::get_value | ( | int | frame, |
PN_stdfloat & | value | ||
) | [virtual] |
Gets the value of the channel at the indicated frame.
Definition at line 99 of file animChannelScalarDynamic.cxx.
bool AnimChannelScalarDynamic::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 79 of file animChannelScalarDynamic.cxx.
TypedWritable * AnimChannelScalarDynamic::make_AnimChannelScalarDynamic | ( | const FactoryParams & | params | ) | [static] |
Factory method to generate a AnimChannelScalarDynamic object.
Definition at line 211 of file animChannelScalarDynamic.cxx.
References AnimChannelScalarDynamic(), and fillin().
Referenced by register_with_read_factory().
AnimGroup * AnimChannelScalarDynamic::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 149 of file animChannelScalarDynamic.cxx.
References AnimChannelScalarDynamic().
void AnimChannelScalarDynamic::register_with_read_factory | ( | ) | [static] |
Factory method to generate a AnimChannelScalarDynamic object.
Reimplemented from AnimGroup.
Definition at line 227 of file animChannelScalarDynamic.cxx.
References BamReader::get_factory(), make_AnimChannelScalarDynamic(), and Factory< Type >::register_factory().
void AnimChannelScalarDynamic::set_value | ( | PN_stdfloat | value | ) |
Explicitly sets the value.
Definition at line 114 of file animChannelScalarDynamic.cxx.
void AnimChannelScalarDynamic::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 128 of file animChannelScalarDynamic.cxx.
References PandaNode::get_transform().
Referenced by MovingPartScalar::apply_control().
void AnimChannelScalarDynamic::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 161 of file animChannelScalarDynamic.cxx.
References Datagram::add_stdfloat(), and BamWriter::write_pointer().