Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

PartBundle Class Reference

This is the root of a MovingPart hierarchy. More...

#include <partBundle.h>

Inheritance diagram for PartBundle:

PartGroup AnimControlCollection TypedWritableReferenceCount Namable TypedWritable ReferenceCount TypedObject CharacterJointBundle List of all members.

Public Types

typedef pmap< AnimControl *,
float > 
ChannelBlend
typedef first_of_pair_iterator<
ChannelBlend::const_iterator > 
control_iterator
typedef ChannelBlend::size_type control_size_type
enum  BlendType { BT_single, BT_linear, BT_normalized_linear }
enum  HierarchyMatchFlags { HMF_ok_part_extra = 0x01, HMF_ok_anim_extra = 0x02, HMF_ok_wrong_root_name = 0x04 }

Public Member Functions

 PartBundle (const string &name="")
 Normally, a PartBundle constructor should not be called directly--it will get created when a PartBundleNode is created.

virtual PartGroupmake_copy () const
 Allocates and returns a new copy of the node.

void set_blend_type (BlendType bt)
 Defines the way the character responds to multiple set_control_effect()).

BlendType get_blend_type () const
 Returns the way the character responds to multiple animations being bound simultaneously.

PartBundleNodeget_node () const
 Returns the PartBundleNode associated with this PartBundle.

void clear_control_effects ()
 Sets the control effect of all AnimControls to zero (but does not "stop" the AnimControls).

void set_control_effect (AnimControl *control, float effect)
 Sets the amount by which the character is affected by the indicated AnimControl (and its associated animation).

float get_control_effect (AnimControl *control)
 Returns the amount by which the character is affected by the indicated AnimControl and its associated animation.

virtual void output (ostream &out) const
 Writes a one-line description of the bundle.

virtual void write (ostream &out, int indent_level) const
 Writes a brief description of the bundle and all of its descendants.

PointerTo< AnimControlbind_anim (AnimBundle *anim, int hierarchy_match_flags=0)
 Binds the animation to the bundle, if possible, and returns a new AnimControl that can be used to start and stop the animation.

bool bind_anim (AnimBundle *anim, const string &name, int hierarchy_match_flags=0)
 Binds the animation to the bundle, if possible, and returns a new AnimControl that can be used to start and stop the animation.

control_iterator control_begin () const
 Returns an iterator that can be used to traverse the entire set of AnimControls currently in effect.

control_iterator control_end () const
 Returns an iterator that can be used to traverse the entire set of AnimControls currently in effect.

control_size_type control_size () const
 Returns the number of entries between control_begin() and control_end(): the number of AnimControls currently in effect.

const ChannelBlendget_blend_map () const
 Returns the entire mapping of AnimControls to blend effect.

void advance_time (double time)
 Calls advance_time() on all AnimControls currently in effect.

bool update ()
 Updates all the parts in the bundle to reflect the data for the current frame (as set in each of the AnimControls).

bool force_update ()
 Updates all the parts in the bundle to reflect the data for the current frame, whether we believe it needs it or not.

virtual void control_activated (AnimControl *control)
 Called by the AnimControl whenever it starts an animation.

virtual void finalize ()
 Method to ensure that any necessary clean up tasks that have to be performed by this object are performed.

virtual TypeHandle get_type () const
virtual TypeHandle force_init_type ()
PartGroupcopy_subgraph () const
 Allocates and returns a new copy of this node and of all of its children.

int get_num_children () const
 Returns the number of child nodes of the group.

PartGroupget_child (int n) const
 Returns the nth child of the group.

PartGroupfind_child (const string &name) const
 Returns the first descendant found with the indicated name, or NULL if no such descendant exists.

virtual void write_with_value (ostream &out, int indent_level) const
 Writes a brief description of the group, showing its current value, and that of all of its descendants.

virtual TypeHandle get_value_type () const
 Returns the TypeHandle associated with the ValueType we are concerned with.

void sort_descendants ()
 Sorts the children nodes at each level of the hierarchy into alphabetical order.

bool check_hierarchy (const AnimGroup *anim, const PartGroup *parent, int hierarchy_match_flags=0) const
 Walks the part hierarchy in tandem with the indicated anim hierarchy, and returns true if the hierarchies match, false otherwise.

virtual bool do_update (PartBundle *root, PartGroup *parent, bool parent_changed, bool anim_changed)
 Recursively update this particular part and all of its descendents for the current frame.

virtual void write_datagram (BamWriter *manager, Datagram &me)
 Function to write the important information in the particular object to a Datagram.

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 pointers that this object made to BamReader.

int get_type_index () const
 Returns the internal index number associated with this object's TypeHandle, a unique number for each different type.

bool is_of_type (TypeHandle handle) const
 Returns true if the current object is or derives from the indicated type.

bool is_exact_type (TypeHandle handle) const
 Returns true if the current object is the indicated type exactly.

int get_ref_count () const
 Returns the current reference count.

int ref () const
 Explicitly increments the reference count.

int unref () const
 Explicitly decrements the reference count.

void test_ref_count_integrity () const
 Does some easy checks to make sure that the reference count isn't completely bogus.

void set_name (const string &name)
void clear_name ()
 Resets the Namable's name to empty.

bool has_name () const
 Returns true if the Namable has a nonempty name set, false if the name is empty.

const string & get_name () const
void store_anim (AnimControl *control, const string &name)
 Associates the given AnimControl with this collection under the given name.

AnimControlfind_anim (const string &name) const
 Returns the AnimControl associated with the given name, or NULL if no such control has been associated.

bool unbind_anim (const string &name)
 Removes the AnimControl associated with the given name, if any.

int get_num_anims () const
 Returns the number of AnimControls associated with this collection.

void clear_anims ()
 Disassociates all anims from this collection.

void set_stop_event (const CPT_Event &stop_event)
 Sets the event that will be thrown when the next animation that is played eventually comes to a stop.

void clear_stop_event ()
 Indicates that the next-started animation will not throw a stop event when it comes to a stop.

bool has_stop_event () const
 Returns true if a stop event has been established via set_stop_event().

CPT_Event get_stop_event () const
 Returns the event that has been established via set_stop_event().

bool play (const string &anim_name)
 Starts the named animation playing.

bool play (const string &anim_name, int from, int to)
 Starts the named animation playing.

bool loop (const string &anim_name, bool restart)
 Starts the named animation looping.

bool loop (const string &anim_name, bool restart, int from, int to)
 Starts the named animation looping.

bool stop (const string &anim_name)
 Stops the named animation.

bool pose (const string &anim_name, int frame)
 Sets to a particular frame in the named animation.

void play_all ()
 Starts all animations playing.

void play_all (int from, int to)
 Starts all animations playing.

void loop_all (bool restart)
 Starts all animations looping.

void loop_all (bool restart, int from, int to)
 Starts all animations looping.

bool stop_all ()
 Stops all currently playing animations.

void pose_all (int frame)
 Sets all animations to the indicated frame.

int get_frame (const string &anim_name) const
 Returns the current frame in the named animation, or 0 if the animation is not found.

int get_frame () const
 Returns the current frame in the last-started animation.

int get_num_frames (const string &anim_name) const
 Returns the total number of frames in the named animation, or 0 if the animation is not found.

bool is_playing (const string &anim_name) const
 Returns true if the named animation is currently playing, false otherwise.

bool is_playing () const
 Returns true if the last-started animation is currently playing, false otherwise.

string which_anim_playing () const
 Returns the name of the bound AnimControl currently playing, if any.


Static Public Member Functions

void register_with_read_factory (void)
 Factory method to generate a PartBundle object.

TypedWritablemake_PartBundle (const FactoryParams &params)
 Factory method to generate a PartBundle object.

TypeHandle get_class_type ()
void init_type ()
TypedWritablemake_PartGroup (const FactoryParams &params)
 Factory method to generate a PartGroup object.


Static Public Attributes

TypedWritable *const Null = (TypedWritable*)0L

Protected Types

typedef pvector< PointerTo<
PartGroup > > 
Children

Protected Member Functions

 PartBundle (const PartBundle &copy)
 Normally, you'd use make_copy() or copy_subgraph() to make a copy of this.

void recompute_net_blend ()
 Recomputes the total blending amount after a control effect has been adjusted.

void clear_and_stop_except (AnimControl *control)
 Removes and stops all the currently activated AnimControls, except for the indicated one.

void write_descendants (ostream &out, int indent_level) const
 Writes a brief description of all of the group's descendants.

void write_descendants_with_value (ostream &out, int indent_level) const
 Writes a brief description of all of the group's descendants and their values.

virtual void pick_channel_index (plist< int > &holes, int &next) const
 Walks the part hierarchy, looking for a suitable channel index number to use.

virtual void bind_hierarchy (AnimGroup *anim, int channel_index)
 Binds the indicated anim hierarchy to the part hierarchy, at the given channel index number.

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.


Protected Attributes

BlendType _blend_type
PartBundleNode_node
AnimControl_last_control_set
ChannelBlend _blend
float _net_blend
bool _anim_changed
Children _children

Static Private Attributes

TypeHandle _type_handle

Friends

class PartBundleNode

Detailed Description

This is the root of a MovingPart hierarchy.

It defines the hierarchy of moving parts that make up an animatable object.

Definition at line 49 of file partBundle.h.


Member Typedef Documentation

typedef pmap<AnimControl *, float> PartBundle::ChannelBlend
 

Definition at line 54 of file partBundle.h.

typedef pvector< PointerTo< PartGroup > > PartGroup::Children [protected, inherited]
 

Definition at line 103 of file partGroup.h.

typedef first_of_pair_iterator<ChannelBlend::const_iterator> PartBundle::control_iterator
 

Definition at line 56 of file partBundle.h.

typedef ChannelBlend::size_type PartBundle::control_size_type
 

Definition at line 57 of file partBundle.h.

Referenced by control_begin().


Member Enumeration Documentation

enum PartBundle::BlendType
 

Enumeration values:
BT_single 
BT_linear 
BT_normalized_linear 

Definition at line 72 of file partBundle.h.

enum PartGroup::HierarchyMatchFlags [inherited]
 

Enumeration values:
HMF_ok_part_extra 
HMF_ok_anim_extra 
HMF_ok_wrong_root_name 

Definition at line 55 of file partGroup.h.


Constructor & Destructor Documentation

PartBundle::PartBundle const PartBundle &  copy  )  [protected]
 

Normally, you'd use make_copy() or copy_subgraph() to make a copy of this.

Definition at line 49 of file partBundle.cxx.

References _anim_changed, and _net_blend.

Referenced by PartBundle().

PartBundle::PartBundle const string &  name = ""  ) 
 

Normally, a PartBundle constructor should not be called directly--it will get created when a PartBundleNode is created.

Definition at line 73 of file partBundle.cxx.

References PartBundle().


Member Function Documentation

void PartBundle::advance_time double  time  ) 
 

Calls advance_time() on all AnimControls currently in effect.

Definition at line 456 of file partBundle.cxx.

bool PartBundle::bind_anim AnimBundle anim,
const string &  name,
int  hierarchy_match_flags = 0
 

Binds the animation to the bundle, if possible, and returns a new AnimControl that can be used to start and stop the animation.

If the anim hierarchy does not match the part hierarchy, returns NULL.

If hierarchy_match_flags is 0, only an exact match is accepted; otherwise, it may contain a union of PartGroup::HierarchyMatchFlags values indicating conditions that will be tolerated (but warnings will still be issued).

This flavor of bind_anim() automatically stores the bound AnimControl in the PartBundle with the indicated name, so that it may later be referenced by name. This means that the animation will not be unbound until another animation with the same name is bound, or it is explicitly unbound with unbind_anim().

The return value is true if the animation was successfully bound, false if there was some error.

Definition at line 434 of file partBundle.cxx.

References PartGroup::do_update(), and NULL.

PointerTo< AnimControl > PartBundle::bind_anim AnimBundle anim,
int  hierarchy_match_flags = 0
 

Binds the animation to the bundle, if possible, and returns a new AnimControl that can be used to start and stop the animation.

If the anim hierarchy does not match the part hierarchy, returns NULL.

If hierarchy_match_flags is 0, only an exact match is accepted; otherwise, it may contain a union of PartGroup::HierarchyMatchFlags values indicating conditions that will be tolerated (but warnings will still be issued).

This flavor of bind_anim() does not associate a name with the channel, and the AnimControl is not stored within the PartBundle; it is the user's responsibility to maintain the pointer. The animation will automatically unbind itself when the AnimControl destructs (i.e. its reference count goes to zero).

Definition at line 355 of file partBundle.cxx.

References _anim_changed, _blend, PartGroup::do_update(), AnimControl::mark_channels(), and NULL.

Referenced by write().

void PartGroup::bind_hierarchy AnimGroup anim,
int  channel_index
[protected, virtual, inherited]
 

Binds the indicated anim hierarchy to the part hierarchy, at the given channel index number.

Reimplemented in MovingPartBase.

Definition at line 526 of file partGroup.cxx.

Referenced by MovingPartBase::pick_channel_index().

bool PartGroup::check_hierarchy const AnimGroup anim,
const PartGroup parent,
int  hierarchy_match_flags = 0
const [inherited]
 

Walks the part hierarchy in tandem with the indicated anim hierarchy, and returns true if the hierarchies match, false otherwise.

If hierarchy_match_flags is 0, only an exact match is accepted; otherwise, it may contain a union of PartGroup::HierarchyMatchFlags values indicating conditions that will be tolerated (but warnings will still be issued).

If there is a discrepancy, it is reported to the indicated output stream, if it is non-null.

Definition at line 251 of file partGroup.cxx.

void PartBundle::clear_and_stop_except AnimControl control  )  [protected]
 

Removes and stops all the currently activated AnimControls, except for the indicated one.

This is a special internal function that's only called when _blend_type is BT_single, to automatically stop all the other currently-executing animations.

Definition at line 640 of file partBundle.cxx.

Referenced by make_copy().

void AnimControlCollection::clear_anims  )  [inherited]
 

Disassociates all anims from this collection.

Definition at line 151 of file animControlCollection.cxx.

References AnimControlCollection::_controls.

void PartBundle::clear_control_effects  ) 
 

Sets the control effect of all AnimControls to zero (but does not "stop" the AnimControls).

The character will no longer be affected by any animation, and will return to its original Jesus pose.

The AnimControls which are no longer associated will not be using any CPU cycles, but they may still be in the "playing" state; if they are later reassociated with the PartBundle they will resume at their current frame as if they'd been running all along.

Definition at line 182 of file partBundle.cxx.

References _anim_changed, and _blend.

void Namable::clear_name  )  [inline, inherited]
 

Resets the Namable's name to empty.

Definition at line 82 of file namable.I.

References Namable::_name, and INLINE.

void AnimControlCollection::clear_stop_event  )  [inline, inherited]
 

Indicates that the next-started animation will not throw a stop event when it comes to a stop.

This does not affect any already-started animations.

Definition at line 55 of file animControlCollection.I.

References AnimControlCollection::_stop_event, INLINE, and NULL.

int PartGroup::complete_pointers TypedWritable **  p_list,
BamReader manager
[virtual, inherited]
 

Takes in a vector of pointes to TypedWritable objects that correspond to all the requests for pointers that this object made to BamReader.

Reimplemented from TypedWritable.

Reimplemented in CharacterJoint.

Definition at line 618 of file partGroup.cxx.

Referenced by CharacterJoint::clear_local_transforms().

void PartBundle::control_activated AnimControl control  )  [virtual]
 

Called by the AnimControl whenever it starts an animation.

This is just a hook so the bundle can do something, if necessary, before the animation starts.

Definition at line 538 of file partBundle.cxx.

Referenced by AnimControl::pingpong(), and AnimControl::play().

PartBundle::control_iterator PartBundle::control_begin  )  const [inline]
 

Returns an iterator that can be used to traverse the entire set of AnimControls currently in effect.

Definition at line 64 of file partBundle.I.

References _blend, control_size_type, and INLINE.

PartBundle::control_iterator PartBundle::control_end  )  const [inline]
 

Returns an iterator that can be used to traverse the entire set of AnimControls currently in effect.

Definition at line 80 of file partBundle.I.

References _blend, and INLINE.

PartBundle::control_size_type PartBundle::control_size  )  const [inline]
 

Returns the number of entries between control_begin() and control_end(): the number of AnimControls currently in effect.

Definition at line 98 of file partBundle.I.

Referenced by make_copy().

PartGroup * PartGroup::copy_subgraph  )  const [inherited]
 

Allocates and returns a new copy of this node and of all of its children.

Definition at line 93 of file partGroup.cxx.

References PartGroup::_children.

bool PartGroup::do_update PartBundle *  root,
PartGroup parent,
bool  parent_changed,
bool  anim_changed
[virtual, inherited]
 

Recursively update this particular part and all of its descendents for the current frame.

This is not really public and is not intended to be called directly; it is called from the top of the tree by PartBundle::update().

The return value is true if any part has changed, false otherwise.

Reimplemented in MovingPartBase.

Definition at line 436 of file partGroup.cxx.

References NULL.

Referenced by bind_anim().

void PartGroup::fillin DatagramIterator scan,
BamReader manager
[protected, inherited]
 

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 TypedWritable.

Reimplemented in MovingPart< SwitchType >, CharacterJoint, MovingPart< ACScalarSwitchType >, and MovingPart< ACMatrixSwitchType >.

Definition at line 594 of file partGroup.cxx.

Referenced by CharacterJointBundle::make_copy(), and MovingPart< SwitchType >::output_value().

void PartBundle::finalize void   )  [virtual]
 

Method to ensure that any necessary clean up tasks that have to be performed by this object are performed.

Reimplemented from TypedWritable.

Definition at line 583 of file partBundle.cxx.

AnimControl * AnimControlCollection::find_anim const string &  name  )  const [inherited]
 

Returns the AnimControl associated with the given name, or NULL if no such control has been associated.

Definition at line 92 of file animControlCollection.cxx.

Referenced by AnimControlCollection::get_frame(), AnimControlCollection::has_stop_event(), AnimControlCollection::loop(), and AnimControlCollection::play().

PartGroup * PartGroup::find_child const string &  name  )  const [inherited]
 

Returns the first descendant found with the indicated name, or NULL if no such descendant exists.

Definition at line 150 of file partGroup.cxx.

References Namable::get_name(), PartGroupAlphabeticalOrder::operator()(), and PT.

Referenced by PartGroup::get_num_children().

virtual TypeHandle PartBundle::force_init_type void   )  [inline, virtual]
 

Reimplemented from PartGroup.

Reimplemented in CharacterJointBundle.

Definition at line 162 of file partBundle.h.

bool PartBundle::force_update  ) 
 

Updates all the parts in the bundle to reflect the data for the current frame, whether we believe it needs it or not.

Definition at line 510 of file partBundle.cxx.

const PartBundle::ChannelBlend & PartBundle::get_blend_map  )  const [inline]
 

Returns the entire mapping of AnimControls to blend effect.

Definition at line 114 of file partBundle.I.

PartBundle::BlendType PartBundle::get_blend_type  )  const [inline]
 

Returns the way the character responds to multiple animations being bound simultaneously.

Definition at line 34 of file partBundle.I.

References _node, and INLINE.

PartGroup * PartGroup::get_child int  n  )  const [inherited]
 

Returns the nth child of the group.

Definition at line 134 of file partGroup.cxx.

References NULL.

TypeHandle PartBundle::get_class_type void   )  [inline, static]
 

Reimplemented from PartGroup.

Reimplemented in CharacterJointBundle.

Definition at line 163 of file partBundle.h.

float PartBundle::get_control_effect AnimControl control  ) 
 

Returns the amount by which the character is affected by the indicated AnimControl and its associated animation.

See set_control_effect().

Definition at line 266 of file partBundle.cxx.

References Namable::get_name().

int AnimControlCollection::get_frame  )  const [inline, inherited]
 

Returns the current frame in the last-started animation.

Definition at line 247 of file animControlCollection.I.

int AnimControlCollection::get_frame const string &  anim_name  )  const [inline, inherited]
 

Returns the current frame in the named animation, or 0 if the animation is not found.

Definition at line 228 of file animControlCollection.I.

References AnimControlCollection::find_anim(), AnimControl::get_num_frames(), INLINE, and NULL.

const string & Namable::get_name  )  const [inline, inherited]
 

Definition at line 109 of file namable.I.

Referenced by ComputedVerticesMaker::add_normal(), GLGraphicsStateGuardian::begin_bind_clip_planes(), GLGraphicsStateGuardian::begin_bind_lights(), BuilderBucket::BuilderBucket(), EggVertex::clear_grefs(), AnimBundleMaker::create_xfm_channel(), SceneGraphReducer::do_flatten_siblings(), BuilderBucket::done_geom(), DXTextureContext8::DXTextureContext8(), PartGroup::find_child(), EggLoader::find_collision_geometry(), EggGroupUniquifier::get_category(), get_control_effect(), PartGroup::get_num_children(), EggMorph< Parameter >::get_offset(), AnimChannelBase::has_changed(), Namable::has_name(), EggMaterial::is_equivalent_to(), Texture::load(), EggLoader::make_node(), AnimBundleMaker::make_node(), FindApproxPath::Component::matches(), LineSegs::move_to(), MovingPartBase::MovingPartBase(), NodeMap::NodeMap(), EggMorph< Parameter >::operator<(), operator<<(), MouseWatcherRegion::output(), AnimGroup::output(), EggXfmSAnim::r_transform(), Texture::read(), MouseWatcherGroup::remove_region(), EggLoader::reparent_decals(), CRGraphicsStateGuardian::set_blend_mode(), NodePath::set_color(), GLGraphicsStateGuardian::set_draw_buffer(), AnimChannelScalarTable::set_table(), NodePath::set_transparency(), NodePathComponent::uncollapse(), Texture::unprepare(), TextNode::wordwrap_to(), MovingPartBase::write(), CollisionNode::xform(), and EggVertex::~EggVertex().

PartBundleNode * PartBundle::get_node  )  const [inline]
 

Returns the PartBundleNode associated with this PartBundle.

Reimplemented in CharacterJointBundle.

Definition at line 49 of file partBundle.I.

References _blend.

Referenced by CharacterJointBundle::CharacterJointBundle().

int AnimControlCollection::get_num_anims  )  const [inherited]
 

Returns the number of AnimControls associated with this collection.

Definition at line 138 of file animControlCollection.cxx.

References AnimControlCollection::_controls.

int PartGroup::get_num_children  )  const [inherited]
 

Returns the number of child nodes of the group.

Definition at line 120 of file partGroup.cxx.

References PartGroup::_children, PartGroup::find_child(), Namable::get_name(), and NULL.

int AnimControlCollection::get_num_frames const string &  anim_name  )  const [inline, inherited]
 

Returns the total number of frames in the named animation, or 0 if the animation is not found.

Definition at line 302 of file animControlCollection.I.

int ReferenceCount::get_ref_count  )  const [inline, inherited]
 

Returns the current reference count.

Definition at line 183 of file referenceCount.I.

Referenced by RenderState::determine_bin_index(), RenderEffects::determine_show_bounds(), FontPool::ns_garbage_collect(), TexturePool::ns_garbage_collect(), MaterialPool::ns_get_material(), and TexturePool::ns_release_texture().

CPT_Event AnimControlCollection::get_stop_event  )  const [inline, inherited]
 

Returns the event that has been established via set_stop_event().

This is the event that will be thrown by animations that are started in the future when they stop. However, this may or may not be associated with any currently-playing animations.

Definition at line 99 of file animControlCollection.I.

virtual TypeHandle PartBundle::get_type void   )  const [inline, virtual]
 

Reimplemented from PartGroup.

Reimplemented in CharacterJointBundle.

Definition at line 159 of file partBundle.h.

int TypedObject::get_type_index  )  const [inline, inherited]
 

Returns the internal index number associated with this object's TypeHandle, a unique number for each different type.

This is equivalent to get_type().get_index().

Definition at line 71 of file typedObject.I.

References TypeHandle::get_name(), TypedObject::get_type(), and INLINE.

TypeHandle PartGroup::get_value_type  )  const [virtual, inherited]
 

Returns the TypeHandle associated with the ValueType we are concerned with.

This is provided to allow a bit of run-time checking that joints and channels are matching properly in type.

Reimplemented in MovingPart< SwitchType >, MovingPartBase, MovingPart< ACScalarSwitchType >, and MovingPart< ACMatrixSwitchType >.

Definition at line 181 of file partGroup.cxx.

bool Namable::has_name  )  const [inline, inherited]
 

Returns true if the Namable has a nonempty name set, false if the name is empty.

Definition at line 97 of file namable.I.

References Namable::get_name(), and INLINE.

Referenced by EggGroupUniquifier::EggGroupUniquifier(), Texture::read(), and Texture::Texture().

bool AnimControlCollection::has_stop_event  )  const [inline, inherited]
 

Returns true if a stop event has been established via set_stop_event().

If true, this means that animations that are to be started in the future will throw this event when they stop. However, it does not necessarily mean that the currently-playing animation will throw this event.

Definition at line 78 of file animControlCollection.I.

References AnimControlCollection::_last_started_control, AnimControlCollection::_stop_event, AnimControlCollection::find_anim(), INLINE, NULL, and AnimControl::play().

void PartBundle::init_type void   )  [inline, static]
 

Reimplemented from PartGroup.

Reimplemented in CharacterJointBundle.

Definition at line 166 of file partBundle.h.

Referenced by CharacterJointBundle::get_type().

bool TypedObject::is_exact_type TypeHandle  handle  )  const [inline, inherited]
 

Returns true if the current object is the indicated type exactly.

Definition at line 101 of file typedObject.I.

Referenced by PT(), and CollisionNode::xform().

bool TypedObject::is_of_type TypeHandle  handle  )  const [inline, inherited]
 

Returns true if the current object is or derives from the indicated type.

Definition at line 86 of file typedObject.I.

Referenced by EggMaterialCollection::collapse_equivalent_materials(), EggTextureCollection::collapse_equivalent_textures(), DeferredNodeProperty::compose(), AnimBundleMaker::create_s_channel(), CharacterMaker::create_slider(), ProjectionScreen::cull_callback(), DataNode::define_output(), EggNode::determine_draw_order(), CharacterMaker::egg_to_index(), EggGroupUniquifier::EggGroupUniquifier(), EggPoolUniquifier::EggPoolUniquifier(), EggGroupNode::find_textures(), StaticTextFont::get_glyph(), EggMaterialCollection::insert_materials(), EggTextureCollection::insert_textures(), CharacterJoint::make_copy(), PT(), EggGroupNode::r_flatten_transforms(), EggGroupNode::r_transform_vertices(), EggGroupNode::recompute_polygon_normals(), CollisionLevelState::reserve(), PandaFramework::reset_frame_rate(), PandaFramework::set_texture(), EggGroupNode::steal_children(), and DataGraphTraverser::traverse().

bool AnimControlCollection::is_playing  )  const [inline, inherited]
 

Returns true if the last-started animation is currently playing, false otherwise.

Definition at line 284 of file animControlCollection.I.

bool AnimControlCollection::is_playing const string &  anim_name  )  const [inline, inherited]
 

Returns true if the named animation is currently playing, false otherwise.

Definition at line 265 of file animControlCollection.I.

bool AnimControlCollection::loop const string &  anim_name,
bool  restart,
int  from,
int  to
[inline, inherited]
 

Starts the named animation looping.

Definition at line 169 of file animControlCollection.I.

References AnimControlCollection::find_anim(), AnimControl::get_frame(), INLINE, and NULL.

bool AnimControlCollection::loop const string &  anim_name,
bool  restart
[inline, inherited]
 

Starts the named animation looping.

Definition at line 150 of file animControlCollection.I.

void AnimControlCollection::loop_all bool  restart,
int  from,
int  to
[inherited]
 

Starts all animations looping.

Definition at line 212 of file animControlCollection.cxx.

References AnimControlCollection::_controls.

void AnimControlCollection::loop_all bool  restart  )  [inherited]
 

Starts all animations looping.

Definition at line 196 of file animControlCollection.cxx.

References AnimControlCollection::_controls.

PartGroup * PartBundle::make_copy  )  const [virtual]
 

Allocates and returns a new copy of the node.

Children are not copied, but see copy_subgraph().

Reimplemented from PartGroup.

Reimplemented in CharacterJointBundle.

Definition at line 92 of file partBundle.cxx.

References _anim_changed, _blend_type, _last_control_set, BT_single, clear_and_stop_except(), control_size(), nassertv, and NULL.

TypedWritable * PartBundle::make_PartBundle const FactoryParams params  )  [static]
 

Factory method to generate a PartBundle object.

Definition at line 597 of file partBundle.cxx.

TypedWritable * PartGroup::make_PartGroup const FactoryParams params  )  [static, inherited]
 

Factory method to generate a PartGroup object.

Definition at line 646 of file partGroup.cxx.

void PartBundle::output ostream &  out  )  const [virtual]
 

Writes a one-line description of the bundle.

Reimplemented from Namable.

Definition at line 289 of file partBundle.cxx.

void PartGroup::pick_channel_index plist< int > &  holes,
int &  next
const [protected, virtual, inherited]
 

Walks the part hierarchy, looking for a suitable channel index number to use.

Available index numbers are the elements of the holes set, as well as next to infinity.

Reimplemented in MovingPartBase.

Definition at line 507 of file partGroup.cxx.

References PartGroup::_children, PartGroup::_num_children, DCAST, TypeHandle::get_name(), PartGroup::get_type(), and TypedWritable::Null.

bool AnimControlCollection::play const string &  anim_name,
int  from,
int  to
[inline, inherited]
 

Starts the named animation playing.

Definition at line 131 of file animControlCollection.I.

bool AnimControlCollection::play const string &  anim_name  )  [inline, inherited]
 

Starts the named animation playing.

Definition at line 112 of file animControlCollection.I.

References AnimControlCollection::_last_started_control, AnimControlCollection::find_anim(), AnimControl::loop(), and NULL.

void AnimControlCollection::play_all int  from,
int  to
[inherited]
 

Starts all animations playing.

Definition at line 180 of file animControlCollection.cxx.

References AnimControlCollection::_controls.

void AnimControlCollection::play_all  )  [inherited]
 

Starts all animations playing.

Definition at line 164 of file animControlCollection.cxx.

References AnimControlCollection::_controls.

bool AnimControlCollection::pose const string &  anim_name,
int  frame
[inline, inherited]
 

Sets to a particular frame in the named animation.

Definition at line 207 of file animControlCollection.I.

References NULL.

void AnimControlCollection::pose_all int  frame  )  [inherited]
 

Sets all animations to the indicated frame.

Definition at line 254 of file animControlCollection.cxx.

void PartBundle::recompute_net_blend  )  [protected]
 

Recomputes the total blending amount after a control effect has been adjusted.

This value must be kept up-to-date so we can normalize the blending amounts.

Definition at line 563 of file partBundle.cxx.

int ReferenceCount::ref  )  const [inline, inherited]
 

Explicitly increments the reference count.

User code should avoid using ref() and unref() directly, which can result in missed reference counts. Instead, let a PointerTo object manage the reference counting automatically.

This function is const, even though it changes the object, because generally fiddling with an object's reference count isn't considered part of fiddling with the object. An object might be const in other ways, but we still need to accurately count the number of references to it.

The return value is the new reference count.

Definition at line 225 of file referenceCount.I.

Referenced by ClientDevice::ClientDevice(), EggGroupNode::find_textures(), EggGroupNode::r_apply_texmats(), EggGroupNode::r_flatten_transforms(), and EggGroupNode::reverse_vertex_ordering().

void PartBundle::register_with_read_factory void   )  [static]
 

Factory method to generate a PartBundle object.

Reimplemented from PartGroup.

Reimplemented in CharacterJointBundle.

Definition at line 618 of file partBundle.cxx.

void PartBundle::set_blend_type BlendType  bt  ) 
 

Defines the way the character responds to multiple set_control_effect()).

By default, the blend_type is BT_single, which disallows multiple animations. In BT_single mode, it is not necessary to explicitly set the control_effect when starting an animation; starting the animation will implicitly remove the control_effect from the previous animation and set it on the current one.

However, if the blend_type is set to any other value, the control_effect must be explicitly set via set_control_effect() whenever an animation is to affect the character.

See partBundle.h for a description of the meaning of each of the BlendType values.

Definition at line 136 of file partBundle.cxx.

References _anim_changed, _blend, and _net_blend.

void PartBundle::set_control_effect AnimControl control,
float  effect
 

Sets the amount by which the character is affected by the indicated AnimControl (and its associated animation).

Normally, this will only be zero or one. Zero indicates the animation does not affect the character, and one means it does.

If the blend_type is not BT_single (see set_blend_type()), it is possible to have multiple AnimControls in effect simultaneously. In this case, the effect is a weight that indicates the relative importance of each AnimControl to the final animation.

Definition at line 222 of file partBundle.cxx.

void Namable::set_name const string &  name  )  [inline, inherited]
 

Definition at line 69 of file namable.I.

References Namable::_name.

Referenced by BuilderBucket::BuilderBucket(), SceneGraphReducer::do_flatten_siblings(), Texture::read(), PandaNode::reparent(), and Texture::Texture().

void AnimControlCollection::set_stop_event const CPT_Event stop_event  )  [inline, inherited]
 

Sets the event that will be thrown when the next animation that is played eventually comes to a stop.

Setting this does not affect any stop event that is pending from a previously-started animation.

Definition at line 38 of file animControlCollection.I.

References AnimControlCollection::_stop_event, INLINE, and NULL.

void PartGroup::sort_descendants  )  [inherited]
 

Sorts the children nodes at each level of the hierarchy into alphabetical order.

This should be done after creating the hierarchy, to guarantee that the correct names will match up together when the AnimBundle is later bound to a PlayerRoot.

Definition at line 211 of file partGroup.cxx.

References AnimGroup::get_num_children().

bool AnimControlCollection::stop const string &  anim_name  )  [inline, inherited]
 

Stops the named animation.

Definition at line 188 of file animControlCollection.I.

References AnimControlCollection::_last_started_control, AnimControl::get_frame(), INLINE, and NULL.

bool AnimControlCollection::stop_all  )  [inherited]
 

Stops all currently playing animations.

Returns true if any animations were stopped, false if none were playing.

Definition at line 232 of file animControlCollection.cxx.

void AnimControlCollection::store_anim AnimControl control,
const string &  name
[inherited]
 

Associates the given AnimControl with this collection under the given name.

The AnimControl will remain associated until a new AnimControl is associated with the same name later, or until unbind_anim() is called with this name.

Definition at line 69 of file animControlCollection.cxx.

References AnimControlCollection::_controls, and NULL.

Referenced by write().

void ReferenceCount::test_ref_count_integrity  )  const [inline, inherited]
 

Does some easy checks to make sure that the reference count isn't completely bogus.

Definition at line 328 of file referenceCount.I.

References INLINE.

Referenced by EggNode::determine_bin(), and ReferenceCount::~ReferenceCount().

bool AnimControlCollection::unbind_anim const string &  name  )  [inherited]
 

Removes the AnimControl associated with the given name, if any.

Returns true if an AnimControl was removed, false if there was no AnimControl with the indicated name.

Definition at line 115 of file animControlCollection.cxx.

References AnimControlCollection::_controls.

int ReferenceCount::unref  )  const [inline, inherited]
 

Explicitly decrements the reference count.

Note that the object will not be implicitly deleted by unref() simply because the reference count drops to zero. (Having a member function delete itself is problematic; plus, we don't have a virtual destructor anyway.) However, see the helper function unref_delete().

User code should avoid using ref() and unref() directly, which can result in missed reference counts. Instead, let a PointerTo object manage the reference counting automatically.

This function is const, even though it changes the object, because generally fiddling with an object's reference count isn't considered part of fiddling with the object. An object might be const in other ways, but we still need to accurately count the number of references to it.

The return value is the new reference count.

Definition at line 293 of file referenceCount.I.

References INLINE.

Referenced by RenderState::determine_bin_index(), and RenderEffects::determine_show_bounds().

bool PartBundle::update  ) 
 

Updates all the parts in the bundle to reflect the data for the current frame (as set in each of the AnimControls).

Returns true if any part has changed as a result of this, or false otherwise.

Definition at line 483 of file partBundle.cxx.

References _blend.

string AnimControlCollection::which_anim_playing  )  const [inherited]
 

Returns the name of the bound AnimControl currently playing, if any.

If more than one AnimControl is currently playing, returns all of the names separated by spaces.

Definition at line 276 of file animControlCollection.cxx.

void PartBundle::write ostream &  out,
int  indent_level
const [virtual]
 

Writes a brief description of the bundle and all of its descendants.

Reimplemented from PartGroup.

Definition at line 304 of file partBundle.cxx.

References bind_anim(), NULL, PT, and AnimControlCollection::store_anim().

void PartGroup::write_datagram BamWriter manager,
Datagram me
[virtual, inherited]
 

Function to write the important information in the particular object to a Datagram.

Implements TypedWritableReferenceCount.

Reimplemented in MovingPart< SwitchType >, CharacterJoint, MovingPart< ACScalarSwitchType >, and MovingPart< ACMatrixSwitchType >.

Definition at line 568 of file partGroup.cxx.

Referenced by MovingPart< SwitchType >::make_initial_channel().

void PartGroup::write_descendants ostream &  out,
int  indent_level
const [protected, inherited]
 

Writes a brief description of all of the group's descendants.

Definition at line 462 of file partGroup.cxx.

Referenced by MovingPartBase::MovingPartBase().

void PartGroup::write_descendants_with_value ostream &  out,
int  indent_level
const [protected, inherited]
 

Writes a brief description of all of the group's descendants and their values.

Definition at line 481 of file partGroup.cxx.

Referenced by MovingPartBase::write().

void PartGroup::write_with_value ostream &  out,
int  indent_level
const [virtual, inherited]
 

Writes a brief description of the group, showing its current value, and that of all of its descendants.

Reimplemented in MovingPartBase.

Definition at line 405 of file partGroup.cxx.


Friends And Related Function Documentation

friend class PartBundleNode [friend]
 

Definition at line 175 of file partBundle.h.


Member Data Documentation

bool PartBundle::_anim_changed [protected]
 

Definition at line 149 of file partBundle.h.

Referenced by bind_anim(), clear_control_effects(), make_copy(), PartBundle(), and set_blend_type().

ChannelBlend PartBundle::_blend [protected]
 

Definition at line 147 of file partBundle.h.

Referenced by bind_anim(), clear_control_effects(), control_begin(), control_end(), get_node(), set_blend_type(), and update().

BlendType PartBundle::_blend_type [protected]
 

Definition at line 143 of file partBundle.h.

Referenced by make_copy().

Children PartGroup::_children [protected, inherited]
 

Definition at line 104 of file partGroup.h.

Referenced by PartGroup::copy_subgraph(), PartGroup::get_num_children(), MovingPartBase::MovingPartBase(), PartGroup::pick_channel_index(), Character::update_to_now(), PartGroup::write(), and MovingPartBase::write().

AnimControl* PartBundle::_last_control_set [protected]
 

Definition at line 146 of file partBundle.h.

Referenced by make_copy().

float PartBundle::_net_blend [protected]
 

Definition at line 148 of file partBundle.h.

Referenced by PartBundle(), and set_blend_type().

PartBundleNode* PartBundle::_node [protected]
 

Definition at line 144 of file partBundle.h.

Referenced by get_blend_type().

TypeHandle PartBundle::_type_handle [static, private]
 

Reimplemented from PartGroup.

Reimplemented in CharacterJointBundle.

Definition at line 34 of file partBundle.cxx.

TypedWritable *const TypedWritable::Null = (TypedWritable*)0L [static, inherited]
 

Definition at line 25 of file typedWritable.cxx.

Referenced by Child::complete_pointers(), Parent::complete_pointers(), Person::complete_pointers(), LoaderFileTypeBam::get_extension(), PartGroup::pick_channel_index(), BamReader::read_pointer(), and AnimGroup::write_datagram().


The documentation for this class was generated from the following files:
Generated on Fri May 2 00:53:10 2003 for Panda by doxygen1.3