mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 10:22:45 -04:00
more assertions for recompute_bound()
This commit is contained in:
parent
17c9ee24ab
commit
541bbe4403
@ -1108,11 +1108,33 @@ recompute_bound() {
|
|||||||
// of our vertices.
|
// of our vertices.
|
||||||
pvector<LPoint3f> vertices;
|
pvector<LPoint3f> vertices;
|
||||||
VertexIterator vi = make_vertex_iterator();
|
VertexIterator vi = make_vertex_iterator();
|
||||||
|
int num_vertices = _coords.size();
|
||||||
for (int p = 0; p < get_num_prims(); p++) {
|
|
||||||
for (int v = 0; v < get_length(p); v++) {
|
if (_vindex.is_null()) {
|
||||||
vertices.push_back(get_next_vertex(vi));
|
// 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_begin = &vertices[0];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user