00001 #pragma once 00002 #ifndef BL7_G2_BOUNDINGSPHERE_H 00003 #define BL7_G2_BOUNDINGSPHERE_H 00004 00005 #include "../core.h" 00006 00007 #include "./Sphere.h" 00008 #include "./BoundingVolume.h" 00009 00010 #include <MathLabs/Vector2.h> 00011 00012 00013 00014 namespace bl7 { 00015 namespace geometry2 { 00016 00017 00018 00024 class BODYLABS_API BoundingSphere 00025 : public Sphere 00026 , public BoundingVolume 00027 { 00028 00029 // ############################################################################# 00030 // Construction / Destruction 00031 // ############################################################################# 00032 public: 00034 BoundingSphere(void) 00035 : Sphere() 00036 { } 00037 00039 ~BoundingSphere(void) 00040 { } 00041 00043 BoundingSphere(const BoundingSphere& rhs) 00044 : Sphere( rhs ) 00045 { } 00046 00048 BoundingSphere& operator = (const BoundingSphere& rhs) 00049 { 00050 Sphere::operator = ( rhs ); 00051 return *this; 00052 } 00053 00055 BoundingSphere(const ml7::Vector2& center, const float radius) 00056 : Sphere( center, radius ) 00057 { } 00058 00060 BoundingSphere(const ml7::Vector2& a, const ml7::Vector2& b, const ml7::Vector2& c) 00061 : Sphere( a, b, c ) 00062 { } 00063 00064 00065 00066 // ############################################################################# 00067 // Overlaps Implementations 00068 // ############################################################################# 00069 public: 00073 bool overlaps(const AABB& aabb) const; 00074 00078 bool overlaps(const BoundingSphere& bs) const; 00079 00080 00081 00082 // ############################################################################# 00083 // Contains Implementations 00084 // ############################################################################# 00085 public: 00089 bool contains(const ml7::Vector2& v) const; 00090 00094 bool contains(const AABB& aabb) const; 00095 00099 bool contains(const BoundingSphere& bs) const; 00100 00101 00102 00103 // ############################################################################# 00104 // Include Implementations 00105 // ############################################################################# 00106 public: 00110 BoundingVolume& include(const ml7::Vector2& v); 00111 00115 BoundingVolume& include(const AABB& aabb); 00116 00120 BoundingVolume& include(const BoundingSphere& bs); 00121 00122 }; // class BODYLABS_API BoundingSphere 00123 00124 00125 00126 } // namespace geometry2 00127 } // namespace bl7 00128 00129 #endif // BL7_G2_BOUNDINGSPHERE_H
1.6.1