Changeset 2124 for GTP/trunk/Lib/Vis/Preprocessing/src/AxisAlignedBox3.h
- Timestamp:
- 02/19/07 02:51:22 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/AxisAlignedBox3.h
r2070 r2124 72 72 void Reduce(int axis, int right, float value); 73 73 74 bool Intersects(const Vector3 &lStart, const Vector3 &lEnd) const; 74 75 75 76 // the size of the box along all the axes … … 93 94 void Include(const int &axis, const float &newBound); 94 95 95 96 int 97 Side(const Plane3 &plane) const; 96 int Side(const Plane3 &plane) const; 98 97 99 98 // Overlap returns 1 if the two axis-aligned boxes overlap .. even weakly … … 121 120 bool Includes(const AxisAlignedBox3 &b) const; 122 121 122 /** Returns true if this point is inside box. 123 */ 123 124 virtual int IsInside(const Vector3 &v) const; 124 125 126 /** Returns true if start and endpoint of the ray is inside box. 127 */ 125 128 virtual int IsInside(const VssRay &v) const; 126 129 … … 203 206 // Returns the intersection of two axis-aligned boxes. 204 207 friend inline AxisAlignedBox3 Intersect(const AxisAlignedBox3 &x, 205 const AxisAlignedBox3 &y);208 const AxisAlignedBox3 &y); 206 209 207 210 // Given 4x4 matrix, transform the current box to new one. 208 211 friend inline AxisAlignedBox3 Transform(const AxisAlignedBox3 &box, 209 const Matrix4x4 &tform);212 const Matrix4x4 &tform); 210 213 211 214 212 215 // returns true when two boxes are completely equal 213 friend inline int operator== (const AxisAlignedBox3 &A, const AxisAlignedBox3 &B); 216 friend inline int operator== (const AxisAlignedBox3 &A, 217 const AxisAlignedBox3 &B); 214 218 215 219 virtual float SurfaceArea() const; 216 virtual float GetVolume() const { 217 return (mMax.x - mMin.x) * (mMax.y - mMin.y) * (mMax.z - mMin.z); 220 virtual float GetVolume() const 221 { 222 return (mMax.x - mMin.x) * (mMax.y - mMin.y) * (mMax.z - mMin.z); 218 223 } 219 224 220 225 // Six faces are distuinguished by their name. 221 enum EFaces { ID_Back = 0, ID_Left = 1, ID_Bottom = 2, ID_Front = 3, 222 ID_Right = 4, ID_Top = 5}; 223 224 int 225 ComputeMinMaxT(const Vector3 &origin, 226 const Vector3 &direction, 227 float *tmin, 228 float *tmax) const; 226 enum EFaces {ID_Back = 0, 227 ID_Left = 1, 228 ID_Bottom = 2, 229 ID_Front = 3, 230 ID_Right = 4, 231 ID_Top = 5}; 232 233 int ComputeMinMaxT(const Vector3 &origin, 234 const Vector3 &direction, 235 float *tmin, 236 float *tmax) const; 229 237 230 238 // Compute tmin and tmax for a ray, whenever required .. need not pierce box … … 243 251 // computes the signed distances for case: tmin < tmax and tmax > 0 244 252 int GetMinMaxT(const Ray &ray, float *tmin, float *tmax, 245 EFaces &entryFace, EFaces &exitFace) const;253 EFaces &entryFace, EFaces &exitFace) const; 246 254 247 255 // Writes a brief description of the object, indenting by the given
Note: See TracChangeset
for help on using the changeset viewer.