mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 02:15:43 -04:00
more assertions for recompute_bound()
This commit is contained in:
parent
17c9ee24ab
commit
541bbe4403
@ -1108,12 +1108,34 @@ recompute_bound() {
|
||||
// of our vertices.
|
||||
pvector<LPoint3f> vertices;
|
||||
VertexIterator vi = make_vertex_iterator();
|
||||
int num_vertices = _coords.size();
|
||||
|
||||
if (_vindex.is_null()) {
|
||||
// Nonindexed case.
|
||||
int vcount = 0;
|
||||
for (int p = 0; p < get_num_prims(); p++) {
|
||||
for (int v = 0; v < get_length(p); v++) {
|
||||
nassertr(vcount < num_vertices, bound);
|
||||
vertices.push_back(get_next_vertex(vi));
|
||||
++vcount;
|
||||
}
|
||||
}
|
||||
nassertr(vcount == num_vertices, bound);
|
||||
|
||||
} else {
|
||||
// Indexed case.
|
||||
int num_indices = _vindex.size();
|
||||
int vindex = 0;
|
||||
for (int p = 0; p < get_num_prims(); p++) {
|
||||
for (int v = 0; v < get_length(p); v++) {
|
||||
nassertr(vindex < num_indices, bound);
|
||||
nassertr(_vindex[vindex] < num_vertices, bound);
|
||||
vertices.push_back(get_next_vertex(vi));
|
||||
++vindex;
|
||||
}
|
||||
}
|
||||
nassertr(vindex == num_indices, bound);
|
||||
}
|
||||
|
||||
const LPoint3f *vertices_begin = &vertices[0];
|
||||
const LPoint3f *vertices_end = vertices_begin + vertices.size();
|
||||
|
Loading…
x
Reference in New Issue
Block a user