00001 // Filename: boundingSphere.I 00002 // Created by: drose (02Oct99) 00003 // 00004 //////////////////////////////////////////////////////////////////// 00005 // 00006 // PANDA 3D SOFTWARE 00007 // Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved 00008 // 00009 // All use of this software is subject to the terms of the Panda 3d 00010 // Software license. You should have received a copy of this license 00011 // along with this source code; you will also find a current copy of 00012 // the license at http://www.panda3d.org/license.txt . 00013 // 00014 // To contact the maintainers of this program write to 00015 // panda3d@yahoogroups.com . 00016 // 00017 //////////////////////////////////////////////////////////////////// 00018 00019 INLINE_MATHUTIL BoundingSphere:: 00020 BoundingSphere() { 00021 } 00022 00023 INLINE_MATHUTIL BoundingSphere:: 00024 BoundingSphere(const LPoint3f ¢er, float radius) : 00025 _center(center), _radius(radius) 00026 { 00027 _flags = 0; 00028 nassertd(!_center.is_nan() && !cnan(_radius)) { 00029 _flags = F_empty; 00030 } 00031 } 00032 00033 INLINE_MATHUTIL const LPoint3f &BoundingSphere:: 00034 get_center() const { 00035 nassertr(!is_empty(), _center); 00036 nassertr(!is_infinite(), _center); 00037 return _center; 00038 } 00039 00040 INLINE_MATHUTIL float BoundingSphere:: 00041 get_radius() const { 00042 nassertr(!is_empty(), 0.0f); 00043 nassertr(!is_infinite(), 0.0f); 00044 return _radius; 00045 } 00046