Panda3D
|
This defines the actual numeric vertex data stored in a Geom, in the structure defined by a particular GeomVertexFormat object. More...
#include "geomVertexData.h"
Classes | |
class | CacheEntry |
class | CacheKey |
class | CData |
class | CDataCache |
Public Types | |
typedef pmap< const CacheKey *, PT(CacheEntry), IndirectLess< CacheKey > > | Cache |
Public Member Functions | |
GeomVertexData (const string &name, const GeomVertexFormat *format, UsageHint usage_hint) | |
GeomVertexData (const GeomVertexData ©) | |
GeomVertexData (const GeomVertexData ©, const GeomVertexFormat *format) | |
This constructor copies all of the basic properties of the source VertexData, like usage_hint and animation tables, but does not copy the actual data, and it allows you to specify a different format. | |
void | clear_animated_vertices () |
Removes the cache of animated vertices computed by a previous call to animate_vertices() within the same frame. | |
void | clear_cache () |
Removes all of the previously-cached results of convert_to(). | |
void | clear_cache_stage () |
Removes all of the previously-cached results of convert_to(), at the current pipeline stage and upstream. | |
void | clear_rows () |
Removes all of the rows from the arrays; functionally equivalent to set_num_rows(0) (but faster). | |
void | clear_slider_table () |
Sets the SliderTable pointer to NULL, removing the table from the vertex data. | |
void | clear_transform_blend_table () |
Sets the TransformBlendTable pointer to NULL, removing the table from the vertex data. | |
void | clear_transform_table () |
Sets the TransformTable pointer to NULL, removing the table from the vertex data. | |
int | compare_to (const GeomVertexData &other) const |
Returns 0 if the two objects are equivalent, even if they are not the same pointer. | |
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 | copy_from (const GeomVertexData *source, bool keep_data_objects, Thread *current_thread=Thread::get_current_thread()) |
Copies all the data from the other array into the corresponding data types in this array, by matching data types name-by-name. | |
void | copy_row_from (int dest_row, const GeomVertexData *source, int source_row, Thread *current_thread) |
Copies a single row of the data from the other array into the indicated row of this array. | |
CPT (GeomVertexData) convert_to(const GeomVertexFormat *new_format) const | |
CPT (GeomVertexArrayData) get_array(int i) const | |
CPT (GeomVertexData) scale_color(const LVecBase4 &color_scale) const | |
CPT (GeomVertexData) scale_color(const LVecBase4 &color_scale | |
CPT (GeomVertexData) set_color(const LColor &color) const | |
CPT (GeomVertexData) set_color(const LColor &color | |
CPT (GeomVertexData) animate_vertices(bool force | |
CPT (GeomVertexData) reverse_normals() const | |
CPT (TransformBlendTable) get_transform_blend_table() const | |
void | describe_vertex (ostream &out, int row) const |
Writes a verbose, human-friendly description of the indicated vertex number. | |
virtual void | finalize (BamReader *manager) |
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. | |
virtual TypeHandle | force_init_type () |
const GeomVertexFormat * | get_format () const |
Returns a pointer to the GeomVertexFormat structure that defines this data. | |
UpdateSeq | get_modified (Thread *current_thread=Thread::get_current_thread()) const |
Returns a sequence number which is guaranteed to change at least every time the vertex data is modified. | |
const string & | get_name () const |
Returns the name passed to the constructor, if any. | |
int | get_num_arrays () const |
Returns the number of individual arrays stored within the data. | |
int | get_num_bytes () const |
Returns the total number of bytes consumed by the different arrays of the vertex data. | |
int | get_num_rows () const |
Returns the number of rows stored within all the arrays. | |
const SliderTable * | get_slider_table () const |
Returns a const pointer to the SliderTable assigned to this data. | |
const TransformTable * | get_transform_table () const |
Returns a const pointer to the TransformTable assigned to this data. | |
virtual TypeHandle | get_type () const |
UsageHint | get_usage_hint () const |
Returns the usage hint that was passed to the constructor, and which will be passed to each array data object created initially, and arrays created as the result of a convert_to() operation. | |
bool | has_column (const InternalName *name) const |
Returns true if the data has the named column, false otherwise. | |
MAKE_SEQ (get_arrays, get_num_arrays, get_array) | |
void | operator= (const GeomVertexData ©) |
The copy assignment operator is not pipeline-safe. | |
void | output (ostream &out) const |
PT (TransformBlendTable) modify_transform_blend_table() | |
PT (GeomVertexArrayData) modify_array(int i) | |
PT (GeomVertexData) replace_column(InternalName *name | |
bool | request_resident () const |
Returns true if the vertex data is currently resident in memory. | |
virtual bool | require_fully_complete () const |
Some objects require all of their nested pointers to have been completed before the objects themselves can be completed. | |
bool | reserve_num_rows (int n) |
This ensures that enough memory space for n rows is allocated, so that you may increase the number of rows to n without causing a new memory allocation. | |
void | set_array (int i, const GeomVertexArrayData *array) |
Replaces the indicated vertex data array with a completely new array. | |
void | set_format (const GeomVertexFormat *format) |
Changes the format of the vertex data. | |
void | set_name (const string &name) |
Changes the name of the vertex data. | |
bool | set_num_rows (int n) |
Sets the length of the array to n rows in all of the various arrays (presumably by adding rows). | |
void | set_slider_table (const SliderTable *table) |
Replaces the SliderTable on this vertex data with the indicated table. | |
void | set_transform_blend_table (const TransformBlendTable *table) |
Replaces the TransformBlendTable on this vertex data with the indicated table. | |
void | set_transform_table (const TransformTable *table) |
Replaces the TransformTable on this vertex data with the indicated table. | |
void | set_usage_hint (UsageHint usage_hint) |
Changes the UsageHint hint for this vertex data, and for all of the arrays that share this data. | |
void | transform_vertices (const LMatrix4 &mat) |
Applies the indicated transform matrix to all of the vertices in the GeomVertexData. | |
void | transform_vertices (const LMatrix4 &mat, int begin_row, int end_row) |
Applies the indicated transform matrix to all of the vertices from begin_row up to but not including end_row. | |
bool | unclean_set_num_rows (int n) |
This method behaves like set_num_rows(), except the new data is not initialized. | |
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. | |
Static Public Member Functions | |
static TypeHandle | get_class_type () |
static void | init_type () |
static PN_uint32 | pack_abcd (unsigned int a, unsigned int b, unsigned int c, unsigned int d) |
Packs four values in a DirectX-style NT_packed_abcd value. | |
static void | register_with_read_factory () |
Tells the BamReader how to create objects of type GeomVertexData. | |
static unsigned int | unpack_abcd_a (PN_uint32 data) |
Returns the first packed value from a DirectX-style NT_packed_abcd. | |
static unsigned int | unpack_abcd_b (PN_uint32 data) |
Returns the second packed value from a DirectX-style NT_packed_abcd. | |
static unsigned int | unpack_abcd_c (PN_uint32 data) |
Returns the third packed value from a DirectX-style NT_packed_abcd. | |
static unsigned int | unpack_abcd_d (PN_uint32 data) |
Returns the fourth packed value from a DirectX-style NT_packed_abcd. | |
Public Attributes | |
int NumericType Contents contents | const |
Thread *current_thread | const |
int | num_components |
int NumericType | numeric_type |
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 GeomVertexData. | |
virtual | PT (CopyOnWriteObject) make_cow_copy() |
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 GeomVertexData is encountered in the Bam file. | |
Friends | |
class | CacheEntry |
class | GeomVertexDataPipelineBase |
class | GeomVertexDataPipelineReader |
class | GeomVertexDataPipelineWriter |
This defines the actual numeric vertex data stored in a Geom, in the structure defined by a particular GeomVertexFormat object.
The data consists of one or more arrays, each of which in turn consists of a series of rows, one per vertex. All arrays should have the same number of rows; each vertex is defined by the column data from a particular row across all arrays.
Often, there will be only one array per Geom, and the various columns defined in the GeomVertexFormat will be interleaved within that array. However, it is also possible to have multiple different arrays, with a certain subset of the total columns defined in each array.
However the data is distributed, the effect is of a single table of vertices, where each vertex is represented by one row of the table.
In general, application code should not attempt to directly manipulate the vertex data through this structure; instead, use the GeomVertexReader, GeomVertexWriter, and GeomVertexRewriter objects to read and write vertex data at a high level.
Definition at line 76 of file geomVertexData.h.
GeomVertexData::GeomVertexData | ( | const GeomVertexData & | copy, |
const GeomVertexFormat * | format | ||
) |
This constructor copies all of the basic properties of the source VertexData, like usage_hint and animation tables, but does not copy the actual data, and it allows you to specify a different format.
Definition at line 130 of file geomVertexData.cxx.
References GeomVertexFormat::get_array(), GeomVertexFormat::get_num_arrays(), and GeomVertexFormat::is_registered().
void GeomVertexData::clear_animated_vertices | ( | ) |
Removes the cache of animated vertices computed by a previous call to animate_vertices() within the same frame.
This will force the next call to animate_vertices() to recompute these values from scratch. Normally it is not necessary to call this.
Definition at line 1098 of file geomVertexData.cxx.
void GeomVertexData::clear_cache | ( | ) |
Removes all of the previously-cached results of convert_to().
This blows away the entire cache, upstream and downstream the pipeline. Use clear_cache_stage() instead if you only want to blow away the cache at the current stage and upstream.
Definition at line 1386 of file geomVertexData.cxx.
Referenced by operator=().
void GeomVertexData::clear_cache_stage | ( | ) |
Removes all of the previously-cached results of convert_to(), at the current pipeline stage and upstream.
Does not affect the downstream cache.
Don't call this in a downstream thread unless you don't mind it blowing away other changes you might have recently made in an upstream thread.
Definition at line 1409 of file geomVertexData.cxx.
Referenced by clear_rows(), set_format(), set_slider_table(), set_transform_blend_table(), set_transform_table(), and set_usage_hint().
void GeomVertexData::clear_rows | ( | ) |
Removes all of the rows from the arrays; functionally equivalent to set_num_rows(0) (but faster).
Don't call this in a downstream thread unless you don't mind it blowing away other changes you might have recently made in an upstream thread.
Definition at line 346 of file geomVertexData.cxx.
References clear_cache_stage(), GeomVertexWriter::get_current_thread(), and Geom::get_next_modified().
void GeomVertexData::clear_slider_table | ( | ) | [inline] |
Sets the SliderTable pointer to NULL, removing the table from the vertex data.
This disables morph (blend shape) animation.
Definition at line 319 of file geomVertexData.I.
References set_slider_table().
void GeomVertexData::clear_transform_blend_table | ( | ) | [inline] |
Sets the TransformBlendTable pointer to NULL, removing the table from the vertex data.
This disables CPU-driven vertex animation.
Definition at line 290 of file geomVertexData.I.
References set_transform_blend_table().
Referenced by copy_from().
void GeomVertexData::clear_transform_table | ( | ) | [inline] |
Sets the TransformTable pointer to NULL, removing the table from the vertex data.
This disables hardware-driven vertex animation.
Definition at line 258 of file geomVertexData.I.
References set_transform_table().
int GeomVertexData::compare_to | ( | const GeomVertexData & | other | ) | const |
Returns 0 if the two objects are equivalent, even if they are not the same pointer.
Definition at line 210 of file geomVertexData.cxx.
int GeomVertexData::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 TypedWritable.
Definition at line 2019 of file geomVertexData.cxx.
Referenced by GeomVertexFormat::complete_pointers().
void GeomVertexData::copy_from | ( | const GeomVertexData * | source, |
bool | keep_data_objects, | ||
Thread * | current_thread = Thread::get_current_thread() |
||
) |
Copies all the data from the other array into the corresponding data types in this array, by matching data types name-by-name.
keep_data_objects specifies what to do when one or more of the arrays can be copied without the need to apply any conversion operation. If it is true, the original GeomVertexArrayData objects in this object are retained, and their data arrays are copied byte-by-byte from the source; if it is false, then the GeomVertexArrayData objects are copied pointerwise from the source.
Don't call this in a downstream thread unless you don't mind it blowing away other changes you might have recently made in an upstream thread.
Definition at line 505 of file geomVertexData.cxx.
References clear_transform_blend_table(), GeomVertexFormat::get_animation(), GeomVertexAnimationSpec::get_animation_type(), GeomVertexWriter::get_array(), GeomVertexFormat::get_array(), GeomVertexFormat::get_array_with(), TransformBlend::get_blend(), GeomVertexArrayFormat::get_column(), GeomVertexReader::get_data1i(), GeomVertexReader::get_data4(), get_format(), GeomVertexAnimationSpec::get_indexed_transforms(), GeomVertexColumn::get_name(), GeomVertexFormat::get_num_arrays(), GeomVertexArrayFormat::get_num_columns(), get_num_rows(), TransformBlend::get_num_transforms(), GeomVertexColumn::get_start(), GeomVertexArrayFormat::get_stride(), TransformBlend::get_transform(), TransformBlend::get_weight(), GeomVertexWriter::has_column(), GeomVertexReader::is_at_end(), GeomVertexColumn::is_bytewise_equivalent(), GeomVertexArrayFormat::is_data_subset_of(), GeomVertexColumn::is_packed_argb(), GeomVertexColumn::is_uint8_rgba(), reserve_num_rows(), set_array(), GeomVertexReader::set_column(), GeomVertexWriter::set_column(), GeomVertexWriter::set_data4(), GeomVertexWriter::set_data4i(), set_num_rows(), set_transform_table(), and LVecBase4f::zero().
Referenced by set_format().
void GeomVertexData::copy_row_from | ( | int | dest_row, |
const GeomVertexData * | source, | ||
int | source_row, | ||
Thread * | current_thread | ||
) |
Copies a single row of the data from the other array into the indicated row of this array.
In this case, the source format must exactly match the destination format.
Don't call this in a downstream thread unless you don't mind it blowing away other changes you might have recently made in an upstream thread.
Definition at line 709 of file geomVertexData.cxx.
References GeomVertexFormat::get_array(), get_format(), GeomVertexFormat::get_num_arrays(), get_num_rows(), GeomVertexArrayFormat::get_stride(), and set_num_rows().
Referenced by GeomPrimitive::make_nonindexed(), and GeomPrimitive::pack_vertices().
void GeomVertexData::describe_vertex | ( | ostream & | out, |
int | row | ||
) | const |
Writes a verbose, human-friendly description of the indicated vertex number.
Definition at line 1311 of file geomVertexData.cxx.
References Datagram::dump_hex(), GeomVertexFormat::get_animation(), GeomVertexAnimationSpec::get_animation_type(), GeomVertexFormat::get_array(), GeomVertexWriter::get_array(), GeomVertexFormat::get_array_with(), TransformBlendTable::get_blend(), GeomVertexFormat::get_column(), GeomVertexReader::get_data1i(), GeomVertexReader::get_data4(), get_format(), GeomVertexColumn::get_name(), GeomVertexFormat::get_num_arrays(), GeomVertexFormat::get_num_columns(), get_num_rows(), GeomVertexColumn::get_num_values(), GeomVertexReader::set_column(), and GeomVertexReader::set_row_unsafe().
void GeomVertexData::fillin | ( | DatagramIterator & | scan, |
BamReader * | manager | ||
) | [protected, virtual] |
This internal function is called by make_from_bam to read in all of the relevant data from the BamFile for the new GeomVertexData.
Reimplemented from TypedWritable.
Definition at line 2101 of file geomVertexData.cxx.
References DatagramIterator::get_string(), BamReader::read_cdata(), and set_name().
Referenced by GeomVertexFormat::fillin().
void GeomVertexData::finalize | ( | BamReader * | manager | ) | [virtual] |
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 from TypedWritable.
Definition at line 2047 of file geomVertexData.cxx.
References BamReader::change_pointer().
const GeomVertexFormat * GeomVertexData::get_format | ( | ) | const [inline] |
Returns a pointer to the GeomVertexFormat structure that defines this data.
Definition at line 55 of file geomVertexData.I.
Referenced by copy_from(), copy_row_from(), describe_vertex(), STBasicTerrain::fill_vertices(), SceneGraphReducer::r_make_nonindexed(), and transform_vertices().
UpdateSeq GeomVertexData::get_modified | ( | Thread * | current_thread = Thread::get_current_thread() | ) | const [inline] |
Returns a sequence number which is guaranteed to change at least every time the vertex data is modified.
Definition at line 343 of file geomVertexData.I.
Referenced by GeomMunger::munge_geom().
const string & GeomVertexData::get_name | ( | ) | const [inline] |
Returns the name passed to the constructor, if any.
This name is reported on the PStats graph for vertex computations.
Definition at line 24 of file geomVertexData.I.
int GeomVertexData::get_num_arrays | ( | ) | const [inline] |
Returns the number of individual arrays stored within the data.
This must match get_format()->get_num_arrays().
Definition at line 171 of file geomVertexData.I.
int GeomVertexData::get_num_bytes | ( | ) | const [inline] |
Returns the total number of bytes consumed by the different arrays of the vertex data.
Definition at line 330 of file geomVertexData.I.
References Thread::get_current_thread().
int GeomVertexData::get_num_rows | ( | ) | const [inline] |
Returns the number of rows stored within all the arrays.
All arrays store data for the same n rows.
Definition at line 81 of file geomVertexData.I.
References Thread::get_current_thread().
Referenced by copy_from(), copy_row_from(), describe_vertex(), GeomPrimitive::make_nonindexed(), GeomPrimitive::pack_vertices(), and transform_vertices().
const SliderTable * GeomVertexData::get_slider_table | ( | ) | const [inline] |
Returns a const pointer to the SliderTable assigned to this data.
Vertices within the vertex data will look up their morph offsets, if any, within this table.
This will return NULL if the vertex data does not have a SliderTable assigned.
Definition at line 306 of file geomVertexData.I.
const TransformTable * GeomVertexData::get_transform_table | ( | ) | const [inline] |
Returns a const pointer to the TransformTable assigned to this data.
Vertices within the table will index into this table to indicate their dynamic skinning information; this table is used when the vertex animation is to be performed by the graphics hardware (but also see get_transform_blend_table()).
This will return NULL if the vertex data does not have a TransformTable assigned (which implies the vertices will not be animated by the graphics hardware).
Definition at line 245 of file geomVertexData.I.
GeomVertexData::UsageHint GeomVertexData::get_usage_hint | ( | ) | const [inline] |
Returns the usage hint that was passed to the constructor, and which will be passed to each array data object created initially, and arrays created as the result of a convert_to() operation.
See geomEnums.h.
However, each individual array may be replaced with a different array object with an independent usage hint specified, so there is no guarantee that the individual arrays all have the same usage_hint.
Definition at line 43 of file geomVertexData.I.
Referenced by SceneGraphReducer::r_make_nonindexed().
bool GeomVertexData::has_column | ( | const InternalName * | name | ) | const [inline] |
Returns true if the data has the named column, false otherwise.
This is really just a shortcut for asking the same thing from the format.
Definition at line 68 of file geomVertexData.I.
TypedWritable * GeomVertexData::make_from_bam | ( | const FactoryParams & | params | ) | [static, protected] |
This function is called by the BamReader's factory when a new object of type GeomVertexData is encountered in the Bam file.
It should create the GeomVertexData and extract its information from the file.
Definition at line 1999 of file geomVertexData.cxx.
References BamReader::register_finalize().
Referenced by GeomVertexFormat::register_with_read_factory(), and register_with_read_factory().
void GeomVertexData::operator= | ( | const GeomVertexData & | copy | ) |
The copy assignment operator is not pipeline-safe.
This will completely obliterate all stages of the pipeline, so don't do it for a GeomVertexData that is actively being used for rendering.
Definition at line 172 of file geomVertexData.cxx.
References clear_cache(), and Geom::get_next_modified().
PN_uint32 GeomVertexData::pack_abcd | ( | unsigned int | a, |
unsigned int | b, | ||
unsigned int | c, | ||
unsigned int | d | ||
) | [inline, static] |
Packs four values in a DirectX-style NT_packed_abcd value.
Definition at line 355 of file geomVertexData.I.
void GeomVertexData::register_with_read_factory | ( | ) | [static] |
Tells the BamReader how to create objects of type GeomVertexData.
Definition at line 1972 of file geomVertexData.cxx.
References BamReader::get_factory(), make_from_bam(), and Factory< Type >::register_factory().
bool GeomVertexData::request_resident | ( | ) | const |
Returns true if the vertex data is currently resident in memory.
If this returns false, the vertex data will be brought back into memory shortly; try again later.
Definition at line 467 of file geomVertexData.cxx.
Referenced by GeomMunger::munge_geom().
bool GeomVertexData::require_fully_complete | ( | ) | const [virtual] |
Some objects require all of their nested pointers to have been completed before the objects themselves can be completed.
If this is the case, override this method to return true, and be careful with circular references (which would make the object unreadable from a bam file).
Reimplemented from TypedWritable.
Definition at line 2035 of file geomVertexData.cxx.
bool GeomVertexData::reserve_num_rows | ( | int | n | ) | [inline] |
This ensures that enough memory space for n rows is allocated, so that you may increase the number of rows to n without causing a new memory allocation.
This is a performance optimization only; it is especially useful when you know ahead of time that you will be adding n rows to the data.
Definition at line 157 of file geomVertexData.I.
References Thread::get_current_thread().
Referenced by copy_from().
void GeomVertexData::set_array | ( | int | i, |
const GeomVertexArrayData * | array | ||
) | [inline] |
Replaces the indicated vertex data array with a completely new array.
You should be careful that the new array has the same length and format as the old one, unless you know what you are doing.
Don't call this in a downstream thread unless you don't mind it blowing away other changes you might have recently made in an upstream thread.
Definition at line 223 of file geomVertexData.I.
References Thread::get_current_thread().
Referenced by copy_from().
void GeomVertexData::set_format | ( | const GeomVertexFormat * | format | ) |
Changes the format of the vertex data.
If the data is not empty, this will implicitly change every row to match the new format.
Don't call this in a downstream thread unless you don't mind it blowing away other changes you might have recently made in an upstream thread.
Definition at line 296 of file geomVertexData.cxx.
References clear_cache_stage(), copy_from(), GeomVertexWriter::get_current_thread(), Geom::get_next_modified(), and GeomVertexFormat::is_registered().
void GeomVertexData::set_name | ( | const string & | name | ) |
Changes the name of the vertex data.
This name is reported on the PStats graph for vertex computations.
Definition at line 248 of file geomVertexData.cxx.
Referenced by fillin().
bool GeomVertexData::set_num_rows | ( | int | n | ) | [inline] |
Sets the length of the array to n rows in all of the various arrays (presumably by adding rows).
The new vertex data is initialized to 0, except for the "color" column, which is initialized to (1, 1, 1, 1).
The return value is true if the number of rows was changed, false if the object already contained n rows (or if there was some error).
Although this method is Published, application code only very rarely has any need to call it. Instead, you should use the GeomVertexWriter to build up the rows in a GeomVertexData object automatically, without need to explicitly set the number of rows.
Don't call this in a downstream thread unless you don't mind it blowing away other changes you might have recently made in an upstream thread.
Definition at line 113 of file geomVertexData.I.
References Thread::get_current_thread().
Referenced by copy_from(), copy_row_from(), and GeomPrimitive::make_nonindexed().
void GeomVertexData::set_slider_table | ( | const SliderTable * | table | ) |
Replaces the SliderTable on this vertex data with the indicated table.
There should be an entry in this table for each kind of morph offset defined in the vertex data.
The SliderTable object must have been registered prior to setting it on the GeomVertexData.
Don't call this in a downstream thread unless you don't mind it blowing away other changes you might have recently made in an upstream thread.
Definition at line 449 of file geomVertexData.cxx.
References clear_cache_stage(), Geom::get_next_modified(), and SliderTable::is_registered().
Referenced by clear_slider_table().
void GeomVertexData::set_transform_blend_table | ( | const TransformBlendTable * | table | ) |
Replaces the TransformBlendTable on this vertex data with the indicated table.
The length of this table should be consistent with the maximum table index assigned to the vertices under the "transform_blend" name.
Don't call this in a downstream thread unless you don't mind it blowing away other changes you might have recently made in an upstream thread.
Definition at line 425 of file geomVertexData.cxx.
References clear_cache_stage(), and Geom::get_next_modified().
Referenced by clear_transform_blend_table().
void GeomVertexData::set_transform_table | ( | const TransformTable * | table | ) |
Replaces the TransformTable on this vertex data with the indicated table.
The length of this table should be consistent with the maximum table index assigned to the vertices under the "transform_index" name.
Don't call this in a downstream thread unless you don't mind it blowing away other changes you might have recently made in an upstream thread.
Definition at line 377 of file geomVertexData.cxx.
References clear_cache_stage(), GeomVertexWriter::get_current_thread(), Geom::get_next_modified(), and TransformTable::is_registered().
Referenced by clear_transform_table(), and copy_from().
void GeomVertexData::set_usage_hint | ( | GeomVertexData::UsageHint | usage_hint | ) |
Changes the UsageHint hint for this vertex data, and for all of the arrays that share this data.
See get_usage_hint().
Don't call this in a downstream thread unless you don't mind it blowing away other changes you might have recently made in an upstream thread.
Definition at line 268 of file geomVertexData.cxx.
References clear_cache_stage(), and Geom::get_next_modified().
void GeomVertexData::transform_vertices | ( | const LMatrix4 & | mat | ) |
Applies the indicated transform matrix to all of the vertices in the GeomVertexData.
The transform is applied to all "point" and "vector" type columns described in the format.
Definition at line 1114 of file geomVertexData.cxx.
References get_num_rows().
void GeomVertexData::transform_vertices | ( | const LMatrix4 & | mat, |
int | begin_row, | ||
int | end_row | ||
) |
Applies the indicated transform matrix to all of the vertices from begin_row up to but not including end_row.
The transform is applied to all "point" and "vector" type columns described in the format.
Definition at line 1127 of file geomVertexData.cxx.
References get_format(), GeomVertexFormat::get_num_points(), GeomVertexFormat::get_num_vectors(), GeomVertexFormat::get_point(), and GeomVertexFormat::get_vector().
bool GeomVertexData::unclean_set_num_rows | ( | int | n | ) | [inline] |
This method behaves like set_num_rows(), except the new data is not initialized.
Furthermore, after this call, *any* of the data in the GeomVertexData may be uninitialized, including the earlier rows.
This is intended for applications that are about to completely fill the GeomVertexData with new data anyway; it provides a tiny performance boost over set_num_rows().
Although this method is Published, application code only very rarely has any need to call it. Instead, you should use the GeomVertexWriter to build up the rows in a GeomVertexData object automatically, without need to explicitly set the number of rows.
Definition at line 140 of file geomVertexData.I.
References Thread::get_current_thread().
unsigned int GeomVertexData::unpack_abcd_a | ( | PN_uint32 | data | ) | [inline, static] |
Returns the first packed value from a DirectX-style NT_packed_abcd.
Definition at line 370 of file geomVertexData.I.
unsigned int GeomVertexData::unpack_abcd_b | ( | PN_uint32 | data | ) | [inline, static] |
Returns the second packed value from a DirectX-style NT_packed_abcd.
Definition at line 381 of file geomVertexData.I.
unsigned int GeomVertexData::unpack_abcd_c | ( | PN_uint32 | data | ) | [inline, static] |
Returns the third packed value from a DirectX-style NT_packed_abcd.
Definition at line 392 of file geomVertexData.I.
unsigned int GeomVertexData::unpack_abcd_d | ( | PN_uint32 | data | ) | [inline, static] |
Returns the fourth packed value from a DirectX-style NT_packed_abcd.
Definition at line 403 of file geomVertexData.I.
Writes the contents of this object to the datagram for shipping out to a Bam file.
Reimplemented from TypedWritable.
Definition at line 1983 of file geomVertexData.cxx.
References Datagram::add_string(), and BamWriter::write_cdata().
Referenced by GeomVertexFormat::write_datagram().