From ecda56d02bc3036506e211f83868e98a05191d47 Mon Sep 17 00:00:00 2001 From: David Rose Date: Wed, 18 Feb 2009 22:49:44 +0000 Subject: [PATCH] make get_center() return a copy so it won't destruct unexpectedly --- panda/src/mathutil/boundingSphere.I | 6 +++--- panda/src/mathutil/boundingSphere.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/panda/src/mathutil/boundingSphere.I b/panda/src/mathutil/boundingSphere.I index 912a039acb..1ae1c30925 100644 --- a/panda/src/mathutil/boundingSphere.I +++ b/panda/src/mathutil/boundingSphere.I @@ -42,10 +42,10 @@ BoundingSphere(const LPoint3f ¢er, float radius) : // Access: Published // Description: //////////////////////////////////////////////////////////////////// -INLINE_MATHUTIL const LPoint3f &BoundingSphere:: +INLINE_MATHUTIL LPoint3f BoundingSphere:: get_center() const { - nassertr(!is_empty(), _center); - nassertr(!is_infinite(), _center); + nassertr(!is_empty(), LPoint3f::zero()); + nassertr(!is_infinite(), LPoint3f::zero()); return _center; } diff --git a/panda/src/mathutil/boundingSphere.h b/panda/src/mathutil/boundingSphere.h index ea61a20abe..875c83b47a 100644 --- a/panda/src/mathutil/boundingSphere.h +++ b/panda/src/mathutil/boundingSphere.h @@ -44,7 +44,7 @@ public: virtual void output(ostream &out) const; PUBLISHED: - INLINE_MATHUTIL const LPoint3f &get_center() const; + INLINE_MATHUTIL LPoint3f get_center() const; INLINE_MATHUTIL float get_radius() const; public: