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

ComputedVerticesMaker Class Reference

An object to collect together all the vertices of a character, indicate what the transform space of each vertex is (which may be a soft-skinned combination of one or more joints), and identify which vertices may be shared together. More...

#include <computedVerticesMaker.h>

List of all members.

Public Member Functions

 ComputedVerticesMaker ()
void begin_new_space ()
 Should be called before beginning the definition for a new transform space.

void add_joint (EggNode *joint, double membership)
 Adds the joint with its associated membership amount to the current transform space definition.

void add_vertex_joints (EggVertex *vertex, EggNode *object)
 Adds the joints the vertex belongs to, along with their respective memberships, to the current transform space definition.

void mark_space ()
 Completes the definition of a transform space as a set of joints and memberships.

int add_vertex (const Vertexd &vertex, const EggMorphVertexList &morphs, const LMatrix4d &transform)
 Adds a vertex value to the currently-defined transform space, and returns its index number within the array.

int add_normal (const Normald &normal, const EggMorphNormalList &morphs, const LMatrix4d &transform)
 Adds a normal value to the currently-defined transform space, and returns its index number within the array.

int add_texcoord (const TexCoordd &texcoord, const EggMorphTexCoordList &morphs, const LMatrix3d &transform)
 Adds a texcoord value to the array (texture coordinates are unrelated to the current transform space), and returns its index number within the array.

int add_color (const Colorf &color, const EggMorphColorList &morphs)
 Adds a color value to the array (color values are unrelated to the current transform space), and returns its index number within the array.

ComputedVerticesmake_computed_vertices (Character *character, CharacterMaker &char_maker)
 After all spaces have been defined and all vertices added, creates a new ComputedVertices object and returns it.

void write (ostream &out) const

Public Attributes

PTA_Vertexf _coords
PTA_Normalf _norms
PTA_Colorf _colors
PTA_TexCoordf _texcoords

Protected Types

typedef pmap< int, LVector3f > VertexMorphList
typedef pmap< int, LVector3f > NormalMorphList
typedef pmap< int, LVector2f > TexCoordMorphList
typedef pmap< int, LVector4f > ColorMorphList
typedef pmap< string, MorphListMorphs
typedef pset< int > Vertices
typedef pmap< JointWeights,
VertexCollection
TransformSpaces

Protected Attributes

Morphs _morphs
Vertices _cindex
Vertices _tindex
ComputedVerticesMakerTexCoordMap _tmap
ComputedVerticesMakerColorMap _cmap
TransformSpaces _transforms
JointWeights _current_jw
VertexCollection_current_vc

Friends

ostream & operator<< (ostream &, const JointWeights &)


Detailed Description

An object to collect together all the vertices of a character, indicate what the transform space of each vertex is (which may be a soft-skinned combination of one or more joints), and identify which vertices may be shared together.

Generally, you use a ComputedVerticesMaker by first defining a transform space via begin_new_space(), repeated calls to add_joint() (or add_vertex_joints()), and then mark_space(). Having done that, you can then add any number of vertices to the space via add_vertex(), add_normal(), etc., and it will return an index number for each vertex, collapsing duplicate vertices together properly. When you are ready to define a new space, simply repeat the process from begin_new_space().

Definition at line 84 of file computedVerticesMaker.h.


Member Typedef Documentation

typedef pmap<int, LVector4f> ComputedVerticesMaker::ColorMorphList [protected]
 

Definition at line 117 of file computedVerticesMaker.h.

typedef pmap<string, MorphList> ComputedVerticesMaker::Morphs [protected]
 

Definition at line 126 of file computedVerticesMaker.h.

typedef pmap<int, LVector3f> ComputedVerticesMaker::NormalMorphList [protected]
 

Definition at line 115 of file computedVerticesMaker.h.

typedef pmap<int, LVector2f> ComputedVerticesMaker::TexCoordMorphList [protected]
 

Definition at line 116 of file computedVerticesMaker.h.

typedef pmap<JointWeights, VertexCollection> ComputedVerticesMaker::TransformSpaces [protected]
 

Definition at line 159 of file computedVerticesMaker.h.

typedef pmap<int, LVector3f> ComputedVerticesMaker::VertexMorphList [protected]
 

Definition at line 114 of file computedVerticesMaker.h.

typedef pset<int> ComputedVerticesMaker::Vertices [protected]
 

Definition at line 129 of file computedVerticesMaker.h.


Constructor & Destructor Documentation

ComputedVerticesMaker::ComputedVerticesMaker  ) 
 

Definition at line 42 of file computedVerticesMaker.cxx.

References NULL.


Member Function Documentation

int ComputedVerticesMaker::add_color const Colorf color,
const EggMorphColorList morphs
 

Adds a color value to the array (color values are unrelated to the current transform space), and returns its index number within the array.

Definition at line 333 of file computedVerticesMaker.cxx.

void ComputedVerticesMaker::add_joint EggNode joint,
double  membership
 

Adds the joint with its associated membership amount to the current transform space definition.

Definition at line 77 of file computedVerticesMaker.cxx.

References _current_jw.

int ComputedVerticesMaker::add_normal const Normald normal,
const EggMorphNormalList morphs,
const LMatrix4d &  transform
 

Adds a normal value to the currently-defined transform space, and returns its index number within the array.

Definition at line 242 of file computedVerticesMaker.cxx.

References _morphs, _texcoords, _tindex, _tmap, ComputedVerticesMaker::MorphList::_tmorphs, ComputedVerticesMakerEntityMap< TexCoordf, EggMorphTexCoordList >::add_value(), EggMorphList< EggMorphTexCoord >::begin(), EggMorphList< EggMorphTexCoord >::end(), Namable::get_name(), EggMorph< Parameter >::get_offset(), LCAST, and TexCoordf.

int ComputedVerticesMaker::add_texcoord const TexCoordd texcoord,
const EggMorphTexCoordList morphs,
const LMatrix3d &  transform
 

Adds a texcoord value to the array (texture coordinates are unrelated to the current transform space), and returns its index number within the array.

Definition at line 291 of file computedVerticesMaker.cxx.

References _morphs.

int ComputedVerticesMaker::add_vertex const Vertexd vertex,
const EggMorphVertexList morphs,
const LMatrix4d &  transform
 

Adds a vertex value to the currently-defined transform space, and returns its index number within the array.

Definition at line 196 of file computedVerticesMaker.cxx.

void ComputedVerticesMaker::add_vertex_joints EggVertex vertex,
EggNode object
 

Adds the joints the vertex belongs to, along with their respective memberships, to the current transform space definition.

Definition at line 113 of file computedVerticesMaker.cxx.

References NULL.

void ComputedVerticesMaker::begin_new_space  ) 
 

Should be called before beginning the definition for a new transform space.

Definition at line 61 of file computedVerticesMaker.cxx.

References _current_jw, _current_vc, and NULL.

ComputedVertices * ComputedVerticesMaker::make_computed_vertices Character character,
CharacterMaker char_maker
 

After all spaces have been defined and all vertices added, creates a new ComputedVertices object and returns it.

Definition at line 373 of file computedVerticesMaker.cxx.

References _colors, _morphs, _norms, and _texcoords.

void ComputedVerticesMaker::mark_space  ) 
 

Completes the definition of a transform space as a set of joints and memberships.

From this point until the next call to begin_new_space(), vertices may be added to the transform space via calls to add_vertex(), add_normal(), etc.

Definition at line 170 of file computedVerticesMaker.cxx.

References _current_vc, _morphs, LCAST, and Vertexf.

void ComputedVerticesMaker::write ostream &  out  )  const
 

Definition at line 509 of file computedVerticesMaker.cxx.


Friends And Related Function Documentation

ostream& operator<< ostream &  out,
const JointWeights jw
[friend]
 

Definition at line 175 of file computedVerticesMaker.h.


Member Data Documentation

Vertices ComputedVerticesMaker::_cindex [protected]
 

Definition at line 131 of file computedVerticesMaker.h.

ComputedVerticesMakerColorMap ComputedVerticesMaker::_cmap [protected]
 

Definition at line 135 of file computedVerticesMaker.h.

PTA_Colorf ComputedVerticesMaker::_colors
 

Definition at line 110 of file computedVerticesMaker.h.

Referenced by make_computed_vertices().

PTA_Vertexf ComputedVerticesMaker::_coords
 

Definition at line 108 of file computedVerticesMaker.h.

JointWeights ComputedVerticesMaker::_current_jw [protected]
 

Definition at line 168 of file computedVerticesMaker.h.

Referenced by add_joint(), and begin_new_space().

VertexCollection* ComputedVerticesMaker::_current_vc [protected]
 

Definition at line 169 of file computedVerticesMaker.h.

Referenced by begin_new_space(), and mark_space().

Morphs ComputedVerticesMaker::_morphs [protected]
 

Definition at line 127 of file computedVerticesMaker.h.

Referenced by add_normal(), add_texcoord(), make_computed_vertices(), and mark_space().

PTA_Normalf ComputedVerticesMaker::_norms
 

Definition at line 109 of file computedVerticesMaker.h.

Referenced by make_computed_vertices().

PTA_TexCoordf ComputedVerticesMaker::_texcoords
 

Definition at line 111 of file computedVerticesMaker.h.

Referenced by add_normal(), and make_computed_vertices().

Vertices ComputedVerticesMaker::_tindex [protected]
 

Definition at line 132 of file computedVerticesMaker.h.

Referenced by add_normal().

ComputedVerticesMakerTexCoordMap ComputedVerticesMaker::_tmap [protected]
 

Definition at line 134 of file computedVerticesMaker.h.

Referenced by add_normal().

TransformSpaces ComputedVerticesMaker::_transforms [protected]
 

Definition at line 160 of file computedVerticesMaker.h.


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