00001 00005 /* Copyright © 2009 James Legg. 00006 This program is free software: you can redistribute it and/or modify 00007 it under the terms of the GNU General Public License as published by 00008 the Free Software Foundation, either version 3 of the License, or 00009 (at your option) any later version. 00010 */ 00011 00012 #ifndef LIBTRACK_AXIS_ALIGNED_BOUNDING_BOX_H_ 00013 #define LIBTRACK_AXIS_ALIGNED_BOUNDING_BOX_H_ 00014 00015 #include <LinearMath/btVector3.h> 00016 #include <LinearMath/btScalar.h> 00017 #include <LinearMath/btTransform.h> 00018 00019 namespace Track 00020 { 00021 00038 class AxisAlignedBoundingBox 00039 { 00040 public: 00043 AxisAlignedBoundingBox(); 00044 virtual ~AxisAlignedBoundingBox(); 00045 00049 void operator|=(const btVector3 & point); 00050 00052 void operator|=(const AxisAlignedBoundingBox & other); 00053 00057 void add_border(btScalar size); 00058 00064 bool valid() const; 00065 00067 btScalar get_max_x() const; 00069 btScalar get_max_y() const; 00071 btScalar get_max_z() const; 00073 btScalar get_min_x() const; 00075 btScalar get_min_y() const; 00077 btScalar get_min_z() const; 00078 00080 btVector3 get_min() const; 00081 00083 btVector3 get_max() const; 00084 00086 btVector3 get_extent() const; 00087 00096 AxisAlignedBoundingBox transform(btTransform transform) const; 00097 protected: 00099 btVector3 min; 00101 btVector3 max; 00102 }; 00103 00107 class AABBBounded 00108 { 00109 public: 00113 virtual AxisAlignedBoundingBox get_bounds() const = 0; 00114 }; 00115 00116 } 00117 00118 #endif /* LIBTRACK_AXIS_ALIGNED_BOUNDING_BOX_H_ */
Generated at Mon Sep 6 00:41:11 2010 by Doxygen version 1.4.7 for Racer version svn335.