00001 // Filename: collisionSphere.I 00002 // Created by: drose (24Apr00) 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 00020 //////////////////////////////////////////////////////////////////// 00021 // Function: CollisionSphere::Constructor 00022 // Access: Public 00023 // Description: 00024 //////////////////////////////////////////////////////////////////// 00025 INLINE CollisionSphere:: 00026 CollisionSphere(const LPoint3f ¢er, float radius) : 00027 _center(center), _radius(radius) 00028 { 00029 } 00030 00031 //////////////////////////////////////////////////////////////////// 00032 // Function: CollisionSphere::Constructor 00033 // Access: Public 00034 // Description: 00035 //////////////////////////////////////////////////////////////////// 00036 INLINE CollisionSphere:: 00037 CollisionSphere(float cx, float cy, float cz, float radius) : 00038 _center(cx, cy, cz), _radius(radius) 00039 { 00040 } 00041 00042 //////////////////////////////////////////////////////////////////// 00043 // Function: CollisionSphere::Constructor 00044 // Access: Public 00045 // Description: 00046 //////////////////////////////////////////////////////////////////// 00047 INLINE CollisionSphere:: 00048 CollisionSphere() { 00049 } 00050 00051 //////////////////////////////////////////////////////////////////// 00052 // Function: CollisionSphere::Copy Constructor 00053 // Access: Public 00054 // Description: 00055 //////////////////////////////////////////////////////////////////// 00056 INLINE CollisionSphere:: 00057 CollisionSphere(const CollisionSphere ©) : 00058 CollisionSolid(copy), 00059 _center(copy._center), 00060 _radius(copy._radius) 00061 { 00062 } 00063 00064 //////////////////////////////////////////////////////////////////// 00065 // Function: CollisionSphere::set_center 00066 // Access: Public 00067 // Description: 00068 //////////////////////////////////////////////////////////////////// 00069 INLINE void CollisionSphere:: 00070 set_center(const LPoint3f ¢er) { 00071 _center = center; 00072 mark_bound_stale(); 00073 mark_viz_stale(); 00074 } 00075 00076 //////////////////////////////////////////////////////////////////// 00077 // Function: CollisionSphere::set_center 00078 // Access: Public 00079 // Description: 00080 //////////////////////////////////////////////////////////////////// 00081 INLINE void CollisionSphere:: 00082 set_center(float x, float y, float z) { 00083 set_center(LPoint3f(x, y, z)); 00084 } 00085 00086 //////////////////////////////////////////////////////////////////// 00087 // Function: CollisionSphere::get_center 00088 // Access: Public 00089 // Description: 00090 //////////////////////////////////////////////////////////////////// 00091 INLINE const LPoint3f &CollisionSphere:: 00092 get_center() const { 00093 return _center; 00094 } 00095 00096 //////////////////////////////////////////////////////////////////// 00097 // Function: CollisionSphere::set_radius 00098 // Access: Public 00099 // Description: 00100 //////////////////////////////////////////////////////////////////// 00101 INLINE void CollisionSphere:: 00102 set_radius(float radius) { 00103 _radius = radius; 00104 mark_bound_stale(); 00105 mark_viz_stale(); 00106 } 00107 00108 //////////////////////////////////////////////////////////////////// 00109 // Function: CollisionSphere::get_radius 00110 // Access: Public 00111 // Description: 00112 //////////////////////////////////////////////////////////////////// 00113 INLINE float CollisionSphere:: 00114 get_radius() const { 00115 return _radius; 00116 } 00117