continue looking for further intersections against remaining triangles in a geom

This commit is contained in:
David Rose 2003-04-16 22:42:34 +00:00
parent 114020c20b
commit c2f3a412dd
2 changed files with 11 additions and 12 deletions

View File

@ -145,12 +145,12 @@ xform(const LMatrix4f &mat) {
// and then convert them back. Hopefully we won't lose too much
// precision during all of this.
if (collide_cat.is_debug()) {
collide_cat.debug()
if (collide_cat.is_spam()) {
collide_cat.spam()
<< "CollisionPolygon transformed by:\n";
mat.write(collide_cat.debug(false), 2);
mat.write(collide_cat.spam(false), 2);
if (_points.empty()) {
collide_cat.debug(false)
collide_cat.spam(false)
<< " (no points)\n";
}
}
@ -627,12 +627,12 @@ setup_points(const LPoint3f *begin, const LPoint3f *end) {
}
}
if (collide_cat.is_debug()) {
collide_cat.debug()
if (collide_cat.is_spam()) {
collide_cat.spam()
<< "CollisionPolygon defined with " << num_points << " vertices:\n";
const LPoint3f *pi;
for (pi = begin; pi != end; ++pi) {
collide_cat.debug(false) << " " << (*pi) << "\n";
collide_cat.spam(false) << " " << (*pi) << "\n";
}
}
#endif

View File

@ -601,11 +601,10 @@ compare_collider_to_geom(CollisionEntry &entry, Geom *geom,
coords[tris[i + 2]])) {
// Generate a temporary CollisionPolygon on the fly for each
// triangle in the Geom.
CollisionPolygon poly(coords[tris[i]], coords[tris[i + 1]],
entry._into =
new CollisionPolygon(coords[tris[i]], coords[tris[i + 1]],
coords[tris[i + 2]]);
if (entry.get_from()->test_intersection((*ci).second, entry, &poly) != 0) {
return;
}
entry.get_from()->test_intersection((*ci).second, entry, entry.get_into());
}
}
}