mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-30 08:44:19 -04:00
collide: fix erroneous collision if sphere is under edge of polygon
Reproducible by the code in #907, occurs if the sphere is close to the edge, but its center is off and under the polygon.
This commit is contained in:
parent
2ed4516cb2
commit
ed73394275
@ -508,8 +508,8 @@ test_intersection_from_sphere(const CollisionEntry &entry) const {
|
|||||||
max_dist = csqrt(max_dist_2);
|
max_dist = csqrt(max_dist_2);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dist > max_dist) {
|
if (dist > max_dist || -dist > max_dist) {
|
||||||
// There's no intersection: the sphere is hanging off the edge.
|
// There's no intersection: the sphere is hanging above or under the edge.
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user