00001 00032 #ifndef LL_BBOXLOCAL_H 00033 #define LL_BBOXLOCAL_H 00034 00035 #include "v3math.h" 00036 00037 class LLMatrix4; 00038 00039 class LLBBoxLocal 00040 { 00041 public: 00042 LLBBoxLocal() {} 00043 LLBBoxLocal( const LLVector3& min, const LLVector3& max ) : mMin( min ), mMax( max ) {} 00044 // Default copy constructor is OK. 00045 00046 const LLVector3& getMin() const { return mMin; } 00047 void setMin( const LLVector3& min ) { mMin = min; } 00048 00049 const LLVector3& getMax() const { return mMax; } 00050 void setMax( const LLVector3& max ) { mMax = max; } 00051 00052 LLVector3 getCenter() const { return (mMax - mMin) * 0.5f + mMin; } 00053 LLVector3 getExtent() const { return mMax - mMin; } 00054 00055 BOOL containsPoint(const LLVector3& p) const; 00056 BOOL intersects(const LLBBoxLocal& b) const; 00057 00058 void addPoint(const LLVector3& p); 00059 void addBBox(const LLBBoxLocal& b) { addPoint( b.mMin ); addPoint( b.mMax ); } 00060 00061 void expand( F32 delta ); 00062 00063 friend LLBBoxLocal operator*(const LLBBoxLocal& a, const LLMatrix4& b); 00064 00065 private: 00066 LLVector3 mMin; 00067 LLVector3 mMax; 00068 }; 00069 00070 LLBBoxLocal operator*(const LLBBoxLocal &a, const LLMatrix4 &b); 00071 00072 00073 #endif // LL_BBOXLOCAL_H