From e34ee0d81bf696e6ed9040c0a6dc40f7141a217c Mon Sep 17 00:00:00 2001 From: David Rose Date: Tue, 12 Jun 2007 03:03:55 +0000 Subject: [PATCH] fix mathutil warnings --- panda/src/mathutil/boundingPlane.cxx | 20 ++++++++++++++++++++ panda/src/mathutil/boundingPlane.h | 2 ++ panda/src/mathutil/boundingSphere.cxx | 4 ++++ 3 files changed, 26 insertions(+) diff --git a/panda/src/mathutil/boundingPlane.cxx b/panda/src/mathutil/boundingPlane.cxx index 7e103856cd..08f36090d9 100644 --- a/panda/src/mathutil/boundingPlane.cxx +++ b/panda/src/mathutil/boundingPlane.cxx @@ -203,3 +203,23 @@ contains_box(const BoundingBox *box) const { return result; } + +//////////////////////////////////////////////////////////////////// +// Function: BoundingPlane::contains_line +// Access: Public, Virtual +// Description: +//////////////////////////////////////////////////////////////////// +int BoundingPlane:: +contains_line(const BoundingLine *line) const { + return IF_possible; +} + +//////////////////////////////////////////////////////////////////// +// Function: BoundingPlane::contains_plane +// Access: Public, Virtual +// Description: +//////////////////////////////////////////////////////////////////// +int BoundingPlane:: +contains_plane(const BoundingPlane *plane) const { + return IF_possible; +} diff --git a/panda/src/mathutil/boundingPlane.h b/panda/src/mathutil/boundingPlane.h index b98e5931a4..9fcaae2a68 100644 --- a/panda/src/mathutil/boundingPlane.h +++ b/panda/src/mathutil/boundingPlane.h @@ -60,6 +60,8 @@ protected: virtual int contains_sphere(const BoundingSphere *sphere) const; virtual int contains_box(const BoundingBox *box) const; + virtual int contains_line(const BoundingLine *line) const; + virtual int contains_plane(const BoundingPlane *plane) const; private: Planef _plane; diff --git a/panda/src/mathutil/boundingSphere.cxx b/panda/src/mathutil/boundingSphere.cxx index 5a8ca323b9..98ce4b6925 100644 --- a/panda/src/mathutil/boundingSphere.cxx +++ b/panda/src/mathutil/boundingSphere.cxx @@ -448,6 +448,10 @@ around_finite(const BoundingVolume **first, for (++p; p != last; ++p) { nassertr(!(*p)->is_infinite(), false); if (!(*p)->is_empty()) { + if (!(*p)->is_of_type(FiniteBoundingVolume::get_class_type())) { + set_infinite(); + return true; + } const FiniteBoundingVolume *vol = DCAST(FiniteBoundingVolume, *p); LPoint3f min1 = vol->get_min(); LPoint3f max1 = vol->get_max();