mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-04 02:42:49 -04:00
Merge remote-tracking branch 'origin/release/1.9.x'
Conflicts: panda/src/gobj/geomVertexData.cxx
This commit is contained in:
commit
46fe58a87a
@ -1187,6 +1187,46 @@ transform_vertices(const LMatrix4 &mat, int begin_row, int end_row) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
// Function: GeomVertexData::transform_vertices
|
||||||
|
// Access: Published
|
||||||
|
// Description: Applies the indicated transform matrix to all of the
|
||||||
|
// vertices mentioned in the sparse array. The
|
||||||
|
// transform is applied to all "point" and "vector"
|
||||||
|
// type columns described in the format.
|
||||||
|
////////////////////////////////////////////////////////////////////
|
||||||
|
void GeomVertexData::
|
||||||
|
transform_vertices(const LMatrix4 &mat, const SparseArray &rows) {
|
||||||
|
if (rows.is_zero()) {
|
||||||
|
// Trivial no-op.
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const GeomVertexFormat *format = get_format();
|
||||||
|
|
||||||
|
size_t ci;
|
||||||
|
for (ci = 0; ci < format->get_num_points(); ci++) {
|
||||||
|
GeomVertexRewriter data(this, format->get_point(ci));
|
||||||
|
|
||||||
|
for (size_t i = 0; i < rows.get_num_subranges(); ++i) {
|
||||||
|
int begin_row = rows.get_subrange_begin(i);
|
||||||
|
int end_row = rows.get_subrange_end(i);
|
||||||
|
do_transform_point_column(format, data, mat, begin_row, end_row);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for (ci = 0; ci < format->get_num_vectors(); ci++) {
|
||||||
|
GeomVertexRewriter data(this, format->get_vector(ci));
|
||||||
|
|
||||||
|
for (size_t i = 0; i < rows.get_num_subranges(); ++i) {
|
||||||
|
int begin_row = rows.get_subrange_begin(i);
|
||||||
|
int end_row = rows.get_subrange_end(i);
|
||||||
|
do_transform_vector_column(format, data, mat, begin_row, end_row);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
// Function: GeomVertexData::do_set_color
|
// Function: GeomVertexData::do_set_color
|
||||||
// Access: Private, Static
|
// Access: Private, Static
|
||||||
|
@ -163,6 +163,7 @@ PUBLISHED:
|
|||||||
void clear_animated_vertices();
|
void clear_animated_vertices();
|
||||||
void transform_vertices(const LMatrix4 &mat);
|
void transform_vertices(const LMatrix4 &mat);
|
||||||
void transform_vertices(const LMatrix4 &mat, int begin_row, int end_row);
|
void transform_vertices(const LMatrix4 &mat, int begin_row, int end_row);
|
||||||
|
void transform_vertices(const LMatrix4 &mat, const SparseArray &rows);
|
||||||
|
|
||||||
PT(GeomVertexData)
|
PT(GeomVertexData)
|
||||||
replace_column(InternalName *name, int num_components,
|
replace_column(InternalName *name, int num_components,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user