mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-04 10:54:24 -04:00
check for collisions with spheres that are moving slightly away from polygon
This commit is contained in:
parent
8a382a8374
commit
14338e4772
@ -415,10 +415,10 @@ test_intersection_from_sphere(const CollisionEntry &entry) const {
|
|||||||
LPoint3f a = sphere->get_center() * wrt_prev_space->get_mat();
|
LPoint3f a = sphere->get_center() * wrt_prev_space->get_mat();
|
||||||
LVector3f delta = b - a;
|
LVector3f delta = b - a;
|
||||||
|
|
||||||
// First, there is no collision if the "from" object is moving in
|
// First, there is no collision if the "from" object is definitely
|
||||||
// the same direction as the plane's normal.
|
// moving in the same direction as the plane's normal.
|
||||||
float dot = delta.dot(get_normal());
|
float dot = delta.dot(get_normal());
|
||||||
if (dot > 0.0f) {
|
if (dot > 0.1f) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user