Classes |
| class | DataTypeRecord |
| class | MorphRecord |
| class | Registry |
Public Member Functions |
|
| GeomVertexFormat (const GeomVertexArrayFormat *array_format) |
|
| GeomVertexFormat (const GeomVertexFormat ©) |
| int | add_array (const GeomVertexArrayFormat *array_format) |
| | Adds the indicated array definition to the list of arrays included within this vertex format definition.
|
| void | align_columns_for_animation () |
| | Reprocesses the columns in the format to align the C_point and C_vector columns to 16-byte boundaries to allow for the more efficient SSE2 operations (assuming SSE2 is enabled in the build).
|
| void | clear_arrays () |
| | Removes all of the array definitions from the format and starts over.
|
|
int | compare_to (const GeomVertexFormat &other) const |
| virtual int | complete_pointers (TypedWritable **plist, BamReader *manager) |
| | Receives an array of pointers, one for each time manager->read_pointer() was called in fillin().
|
|
| CPT (GeomVertexFormat) get_post_animated_format() const |
|
| CPT (GeomVertexFormat) get_union_format(const GeomVertexFormat *other) const |
|
virtual TypeHandle | force_init_type () |
| const GeomVertexAnimationSpec & | get_animation () const |
| | Returns the GeomVertexAnimationSpec that indicates how this format's vertices are set up for animation.
|
| const GeomVertexArrayFormat * | get_array (int array) const |
| | Returns the description of the nth array used by the format.
|
| bool | get_array_info (const InternalName *name, int &array_index, const GeomVertexColumn *&column) const |
| | Quickly looks up the indicated column within all of the nested arrays and sets array_index and column appropriately.
|
| int | get_array_with (int i) const |
| | Returns the index number of the array with the ith column.
|
| int | get_array_with (const InternalName *name) const |
| | Returns the index number of the array with the indicated column, or -1 if no arrays contained that name.
|
| int | get_color_array_index () const |
| | Returns the array index of the array including the "color" column, or -1 if there is no such array.
|
| const GeomVertexColumn * | get_color_column () const |
| | Returns the column definition of the "color" column, or NULL if there is no such column.
|
| const GeomVertexColumn * | get_column (int i) const |
| | Returns the ith column of the specification, across all arrays.
|
| const GeomVertexColumn * | get_column (const InternalName *name) const |
| | Returns the specification with the indicated name, or NULL if the name is not used.
|
| const InternalName * | get_morph_base (int n) const |
| | Returns the name of the base column that the nth morph modifies.
|
| const InternalName * | get_morph_delta (int n) const |
| | Returns the name of the column that defines the nth morph.
|
| const InternalName * | get_morph_slider (int n) const |
| | Returns the slider name associated with the nth morph column.
|
| int | get_normal_array_index () const |
| | Returns the array index of the array including the "normal" column, or -1 if there is no such array.
|
| const GeomVertexColumn * | get_normal_column () const |
| | Returns the column definition of the "normal" column, or NULL if there is no such column.
|
| int | get_num_arrays () const |
| | Returns the number of individual arrays required by the format.
|
| int | get_num_columns () const |
| | Returns the total number of different columns in the specification, across all arrays.
|
| int | get_num_morphs () const |
| | Returns the number of columns within the format that represent morph deltas.
|
| int | get_num_points () const |
| | Returns the number of columns within the format that represent points in space.
|
| int | get_num_texcoords () const |
| | Returns the number of columns within the format that represent texture coordinates.
|
| int | get_num_vectors () const |
| | Returns the number of columns within the format that represent directional vectors.
|
| const InternalName * | get_point (int n) const |
| | Returns the name of the nth point column.
|
| const InternalName * | get_texcoord (int n) const |
| | Returns the name of the nth texcoord column.
|
|
virtual TypeHandle | get_type () const |
| const InternalName * | get_vector (int n) const |
| | Returns the name of the nth vector column.
|
| int | get_vertex_array_index () const |
| | Returns the array index of the array including the "vertex" column, or -1 if there is no such array.
|
| const GeomVertexColumn * | get_vertex_column () const |
| | Returns the column definition of the "vertex" column, or NULL if there is no such column.
|
| bool | has_column (const InternalName *name) const |
| | Returns true if the format has the named column, false otherwise.
|
| void | insert_array (int array, const GeomVertexArrayFormat *array_format) |
| | Adds the indicated array definition to the list of arrays at the indicated position.
|
| bool | is_registered () const |
| | Returns true if this format has been registered, false if it has not.
|
|
| MAKE_SEQ (get_morph_deltas, get_num_morphs, get_morph_delta) |
|
| MAKE_SEQ (get_points, get_num_points, get_point) |
|
| MAKE_SEQ (get_texcoords, get_num_texcoords, get_texcoord) |
|
| MAKE_SEQ (get_arrays, get_num_arrays, get_array) |
|
| MAKE_SEQ (get_columns, get_num_columns, get_column) |
|
| MAKE_SEQ (get_morph_bases, get_num_morphs, get_morph_base) |
|
| MAKE_SEQ (get_morph_sliders, get_num_morphs, get_morph_slider) |
|
| MAKE_SEQ (get_vectors, get_num_vectors, get_vector) |
| void | maybe_align_columns_for_animation () |
| | Calls align_columns_for_animation() if this format's AnimationSpec indicates that it contains animated vertices, and if vertex-animation-align-16 is true.
|
| GeomVertexArrayFormat * | modify_array (int array) |
| | Returns a modifiable pointer to the indicated array.
|
|
void | operator= (const GeomVertexFormat ©) |
|
void | output (ostream &out) const |
| void | pack_columns () |
| | Removes wasted space between columns.
|
| void | remove_array (int array) |
| | Removes the nth array from the format.
|
| void | remove_column (const InternalName *name) |
| | Removes the named column from the format, from whichever array it exists in.
|
| void | set_animation (const GeomVertexAnimationSpec &animation) |
| | Resets the GeomVertexAnimationSpec that indicates how this format's vertices are set up for animation.
|
| void | set_array (int array, const GeomVertexArrayFormat *format) |
| | Replaces the definition of the indicated array.
|
| virtual bool | unref () const |
| | This method overrides ReferenceCount::unref() to unregister the object when its reference count goes to zero.
|
|
void | write (ostream &out, int indent_level=0) const |
| virtual void | write_datagram (BamWriter *manager, Datagram &dg) |
| | Writes the contents of this object to the datagram for shipping out to a Bam file.
|
|
void | write_with_data (ostream &out, int indent_level, const GeomVertexData *data) const |
Static Public Member Functions |
|
static | CPT (GeomVertexFormat) register_format(const GeomVertexFormat *format) |
|
static | CPT (GeomVertexFormat) register_format(const GeomVertexArrayFormat *format) |
|
static TypeHandle | get_class_type () |
| static const GeomVertexFormat * | get_v3 () |
| | Returns a standard vertex format with just a 3-component vertex position.
|
| static const GeomVertexFormat * | get_v3c4 () |
| | Returns a standard vertex format with a 4-component color and a 3-component vertex position.
|
| static const GeomVertexFormat * | get_v3c4t2 () |
| | Returns a standard vertex format with a 2-component texture coordinate pair, a 4-component color, and a 3-component vertex position.
|
| static const GeomVertexFormat * | get_v3cp () |
| | Returns a standard vertex format with a packed color and a 3-component vertex position.
|
| static const GeomVertexFormat * | get_v3cpt2 () |
| | Returns a standard vertex format with a 2-component texture coordinate pair, a packed color, and a 3-component vertex position.
|
| static const GeomVertexFormat * | get_v3n3 () |
| | Returns a standard vertex format with a 3-component normal and a 3-component vertex position.
|
| static const GeomVertexFormat * | get_v3n3c4 () |
| | Returns a standard vertex format with a 4-component color, a 3-component normal, and a 3-component vertex position.
|
| static const GeomVertexFormat * | get_v3n3c4t2 () |
| | Returns a standard vertex format with a 2-component texture coordinate pair, a 4-component color, a 3-component normal, and a 3-component vertex position.
|
| static const GeomVertexFormat * | get_v3n3cp () |
| | Returns a standard vertex format with a packed color, a 3-component normal, and a 3-component vertex position.
|
| static const GeomVertexFormat * | get_v3n3cpt2 () |
| | Returns a standard vertex format with a 2-component texture coordinate pair, a packed color, a 3-component normal, and a 3-component vertex position.
|
| static const GeomVertexFormat * | get_v3n3t2 () |
| | Returns a standard vertex format with a 2-component texture coordinate pair, a 3-component normal, and a 3-component vertex position.
|
| static const GeomVertexFormat * | get_v3t2 () |
| | Returns a standard vertex format with a 2-component texture coordinate pair and a 3-component vertex position.
|
|
static void | init_type () |
| static void | register_with_read_factory () |
| | Tells the BamReader how to create objects of type GeomVertexFormat.
|
Protected Member Functions |
| void | fillin (DatagramIterator &scan, BamReader *manager) |
| | This internal function is called by make_from_bam to read in all of the relevant data from the BamFile for the new GeomVertexFormat.
|
Static Protected Member Functions |
| static TypedWritable * | make_from_bam (const FactoryParams ¶ms) |
| | This function is called by the BamReader's factory when a new object of type GeomVertexFormat is encountered in the Bam file.
|
Friends |
|
class | GeomMunger |
|
class | GeomVertexFormat::Registry |
This class defines the physical layout of the vertex data stored within a Geom.
The layout consists of a list of named columns, each of which has a numeric type and a size.
The columns are typically interleaved within a single array, but they may also be distributed among multiple different arrays; at the extreme, each column may be alone within its own array (which amounts to a parallel-array definition).
Thus, a GeomVertexFormat is really a list of GeomVertexArrayFormats, each of which contains a list of columns. However, a particular column name should not appear more than once in the format, even between different arrays.
There are a handful of standard pre-defined GeomVertexFormat objects, or you may define your own as needed. You may record any combination of standard and/or user-defined columns in your custom GeomVertexFormat constructions.
Definition at line 61 of file geomVertexFormat.h.