From 29cdd78c4ed862a171c3209a1f632a6cafc51fde Mon Sep 17 00:00:00 2001 From: rdb Date: Mon, 18 Jan 2021 19:03:00 +0100 Subject: [PATCH] mathutil: Fix scaling BoundingSphere to infinite causing assertions This error occurs when a BoundingSphere with a large radius is scaled by an even larger radius such that the radius becomes infinite. In this case, the BoundingSphere should be properly marked as infinite so that it behaves properly (and doesn't cause other assertions down the line). --- panda/src/mathutil/boundingSphere.cxx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/panda/src/mathutil/boundingSphere.cxx b/panda/src/mathutil/boundingSphere.cxx index 32e48adad9..beb6cb6309 100644 --- a/panda/src/mathutil/boundingSphere.cxx +++ b/panda/src/mathutil/boundingSphere.cxx @@ -112,6 +112,10 @@ xform(const LMatrix4 &mat) { // Transform the center _center = _center * mat; + + if (cinf(_radius)) { + set_infinite(); + } } }