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

ComputedVertices Class Reference

These are the vertices that must be animated as part of the normal character animation. More...

#include <computedVertices.h>

Inheritance diagram for ComputedVertices:

TypedWritableReferenceCount TypedWritable ReferenceCount TypedObject List of all members.

Public Member Functions

 ComputedVertices ()
void update (Character *character)
 Recomputes all of the _coords, _norms, etc.

void make_orig (Character *character)
 Copies all the values loaded in the _coords, _norms, etc.

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

virtual TypeHandle get_type () const
virtual TypeHandle force_init_type ()
virtual int complete_pointers (TypedWritable **p_list, BamReader *manager)
 Receives an array of pointers, one for each time manager->read_pointer() was called in fillin().

virtual void finalize ()
 Called by the BamReader to perform any final actions needed for setting up the object after all objects have been read and all pointers have been completed.

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.


Static Public Member Functions

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

TypedWritablemake_ComputedVertices (const FactoryParams &params)
 Factory method to generate a ComputedVertices object.

TypeHandle get_class_type ()
void init_type ()

Static Public Attributes

TypedWritable *const Null = (TypedWritable*)0L

Protected Member Functions

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.


Private Types

typedef vector_ushort Vertices
typedef pvector< VertexTransformVertexTransforms
typedef pvector< ComputedVerticesMorphVertexVertexMorphs
typedef pvector< ComputedVerticesMorphNormalNormalMorphs
typedef pvector< ComputedVerticesMorphTexCoordTexCoordMorphs
typedef pvector< ComputedVerticesMorphColorColorMorphs

Private Attributes

VertexTransforms _transforms
VertexMorphs _vertex_morphs
NormalMorphs _normal_morphs
TexCoordMorphs _texcoord_morphs
ColorMorphs _color_morphs
PTA_Vertexf _orig_coords
PTA_Normalf _orig_norms
PTA_Colorf _orig_colors
PTA_TexCoordf _orig_texcoords

Static Private Attributes

TypeHandle _type_handle

Friends

class ComputedVerticesMaker

Detailed Description

These are the vertices that must be animated as part of the normal character animation.

This includes vertices animated into one or more joints, as well as morph vertices.

Definition at line 49 of file computedVertices.h.


Member Typedef Documentation

typedef pvector<ComputedVerticesMorphColor> ComputedVertices::ColorMorphs [private]
 

Definition at line 83 of file computedVertices.h.

typedef pvector<ComputedVerticesMorphNormal> ComputedVertices::NormalMorphs [private]
 

Definition at line 81 of file computedVertices.h.

typedef pvector<ComputedVerticesMorphTexCoord> ComputedVertices::TexCoordMorphs [private]
 

Definition at line 82 of file computedVertices.h.

typedef pvector<ComputedVerticesMorphVertex> ComputedVertices::VertexMorphs [private]
 

Definition at line 80 of file computedVertices.h.

typedef pvector<VertexTransform> ComputedVertices::VertexTransforms [private]
 

Definition at line 76 of file computedVertices.h.

typedef vector_ushort ComputedVertices::Vertices [private]
 

Definition at line 59 of file computedVertices.h.


Constructor & Destructor Documentation

ComputedVertices::ComputedVertices  )  [inline]
 

Definition at line 43 of file computedVertices.I.

References ComputedVertices::VertexTransform::_effect, ComputedVertices::VertexTransform::_joint_index, and INLINE.


Member Function Documentation

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

Receives an array of pointers, one for each time manager->read_pointer() was called in fillin().

Returns the number of pointers processed.

This is the callback function that is made by the BamReader at some later point, after all of the required pointers have been filled in. It is necessary because there might be forward references in a bam file; when we call read_pointer() in fillin(), the object may not have been read from the file yet, so we do not have a pointer available at that time. Thus, instead of returning a pointer, read_pointer() simply reserves a later callback. This function provides that callback. The calling object is responsible for keeping track of the number of times it called read_pointer() and extracting the same number of pointers out of the supplied vector, and storing them appropriately within the object.

Reimplemented in AnimBundleNode, AnimGroup, PartBundleNode, PartGroup, Character, CharacterJoint, CollisionNode, GeomSprite, PiecewiseCurve, ClipPlaneAttrib, FogAttrib, LensNode, LightAttrib, MaterialAttrib, RenderEffects, RenderState, TextureAttrib, Person, and Child.

Definition at line 94 of file typedWritable.cxx.

Referenced by RenderState::do_invert_compose().

void ComputedVertices::fillin DatagramIterator scan,
BamReader manager
[protected]
 

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.

Definition at line 409 of file computedVertices.cxx.

void TypedWritable::finalize void   )  [virtual, inherited]
 

Called by the BamReader to perform any final actions needed for setting up the object after all objects have been read and all pointers have been completed.

Reimplemented in PartBundle, RenderAttrib, RenderEffect, RenderEffects, RenderState, and TransformState.

Definition at line 112 of file typedWritable.cxx.

Referenced by BamReader::skip_pointer().

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

Reimplemented from TypedWritableReferenceCount.

Definition at line 107 of file computedVertices.h.

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

Reimplemented from TypedWritableReferenceCount.

Definition at line 108 of file computedVertices.h.

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().

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

Reimplemented from TypedWritableReferenceCount.

Definition at line 104 of file computedVertices.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.

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

Reimplemented from TypedWritableReferenceCount.

Definition at line 111 of file computedVertices.h.

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().

TypedWritable * ComputedVertices::make_ComputedVertices const FactoryParams params  )  [static]
 

Factory method to generate a ComputedVertices object.

Definition at line 464 of file computedVertices.cxx.

void ComputedVertices::make_orig Character character  ) 
 

Copies all the values loaded in the _coords, _norms, etc.

arrays into the corresponding _orig_coords, etc. arrays.

Definition at line 268 of file computedVertices.cxx.

References _orig_texcoords.

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 ComputedVertices::register_with_read_factory void   )  [static]
 

Factory method to generate a ComputedVertices object.

Definition at line 484 of file computedVertices.cxx.

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().

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().

void ComputedVertices::update Character character  ) 
 

Recomputes all of the _coords, _norms, etc.

values based on the values in _orig_coords, _orig_norms, etc., and the current positions of all of the joints.

Definition at line 161 of file computedVertices.cxx.

References compute_morphs(), and Normalf.

void ComputedVertices::write ostream &  out,
Character character
const
 

Definition at line 308 of file computedVertices.cxx.

References _texcoord_morphs.

void ComputedVertices::write_datagram BamWriter manager,
Datagram me
[virtual]
 

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

Implements TypedWritableReferenceCount.

Definition at line 358 of file computedVertices.cxx.


Friends And Related Function Documentation

friend class ComputedVerticesMaker [friend]
 

Definition at line 119 of file computedVertices.h.


Member Data Documentation

ColorMorphs ComputedVertices::_color_morphs [private]
 

Definition at line 87 of file computedVertices.h.

NormalMorphs ComputedVertices::_normal_morphs [private]
 

Definition at line 85 of file computedVertices.h.

PTA_Colorf ComputedVertices::_orig_colors [private]
 

Definition at line 91 of file computedVertices.h.

PTA_Vertexf ComputedVertices::_orig_coords [private]
 

Definition at line 89 of file computedVertices.h.

PTA_Normalf ComputedVertices::_orig_norms [private]
 

Definition at line 90 of file computedVertices.h.

PTA_TexCoordf ComputedVertices::_orig_texcoords [private]
 

Definition at line 92 of file computedVertices.h.

Referenced by make_orig().

TexCoordMorphs ComputedVertices::_texcoord_morphs [private]
 

Definition at line 86 of file computedVertices.h.

Referenced by write().

VertexTransforms ComputedVertices::_transforms [private]
 

Definition at line 78 of file computedVertices.h.

TypeHandle ComputedVertices::_type_handle [static, private]
 

Reimplemented from TypedWritableReferenceCount.

Definition at line 36 of file computedVertices.cxx.

VertexMorphs ComputedVertices::_vertex_morphs [private]
 

Definition at line 84 of file computedVertices.h.

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:48:43 2003 for Panda by doxygen1.3