HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
UT_OBBox.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * NAME: UT_OBBox.h ( UT Library, C++)
7  *
8  * COMMENTS:
9  */
10 
11 #ifndef __UT_OBBox_h__
12 #define __UT_OBBox_h__
13 
14 #include "UT_API.h"
15 #include "UT_Matrix3.h"
16 #include "UT_Vector3.h"
17 #include "UT_BoundingBox.h"
18 #include "UT_QuickHull.h"
19 
20 template<typename T>
21 class UT_Array;
22 
23 /// Arbitrarily Oriented Bounding (OBB)
24 template <typename T>
26 {
27 public:
28  UT_OBBoxT();
30  UT_OBBoxT(const UT_Array<UT_Vector3T<T> > &points, int refinement = 6);
31 
32  bool operator==(const UT_OBBoxT<T> &other) const;
33 
34  /// Calculate the OBB for the set of points
35  void calcOBB(const UT_Array<UT_Vector3T<T> > &points, int refinement = 6);
36  /// Return the basis that defines the orientation of the OBB
37  UT_Matrix3T<T> getBasis() const {return myBasis;}
38  /// Return the half radii(side length) of the OBB
39  UT_Vector3T<T> getRadii() const {return myRadii;}
40  /// Return the rotation i radians
41  UT_Vector3T<T> getRotation() const {return myRotation;}
42  /// Return the center of the OBB
43  UT_Vector3T<T> getCenter() const {return myCenter;}
44  /// Return the tranform matrix of the OBB
45  UT_Matrix4T<T> getTransform() const;
46  /// Return the non-oriented bounding box.
47  UT_BoundingBoxT<T> getBBox() const {return myBB;}
48  /// Return the given axis direction
49  UT_Vector3T<T> getAxis(int axis) const;
50  /// Return the minimum axis direction
51  UT_Vector3T<T> getMinAxis() const;
52 
53 protected:
59  bool init;
60 };
61 
65 typedef UT_OBBoxT<float> UT_OBBox; // deprecated
66 
67 #endif
UT_Matrix3T< T > myBasis
Definition: UT_OBBox.h:55
Axis-aligned bounding box (AABB).
Definition: GEO_Detail.h:43
GLuint GLenum GLenum transform
Definition: glew.h:14742
UT_OBBoxT< float > UT_OBBox
Definition: UT_OBBox.h:65
Arbitrarily Oriented Bounding (OBB)
Definition: UT_OBBox.h:25
UT_Matrix3T< T > getBasis() const
Return the basis that defines the orientation of the OBB.
Definition: UT_OBBox.h:37
#define UT_API
Definition: UT_API.h:13
3D Vector class.
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
Definition: Dimensions.h:137
UT_OBBoxT< fpreal > UT_OBBoxR
Definition: UT_OBBox.h:62
UT_OBBoxT< fpreal64 > UT_OBBoxD
Definition: UT_OBBox.h:64
UT_Vector3T< T > getRadii() const
Return the half radii(side length) of the OBB.
Definition: UT_OBBox.h:39
UT_Vector3T< T > getRotation() const
Return the rotation i radians.
Definition: UT_OBBox.h:41
UT_BoundingBoxT< T > getBBox() const
Return the non-oriented bounding box.
Definition: UT_OBBox.h:47
GT_Basis myBasis
Definition: GT_CurveEval.h:262
GLuint GLdouble GLdouble GLint GLint const GLdouble * points
Definition: glew.h:3446
UT_Vector3T< T > getCenter() const
Return the center of the OBB.
Definition: UT_OBBox.h:43
UT_OBBoxT< fpreal32 > UT_OBBoxF
Definition: UT_OBBox.h:63
bool init
Definition: UT_OBBox.h:59
UT_Vector3T< T > myRotation
Definition: UT_OBBox.h:57
UT_Vector3T< T > myRadii
Definition: UT_OBBox.h:58
UT_BoundingBoxT< T > myBB
Definition: UT_OBBox.h:54
UT_Vector3T< T > myCenter
Definition: UT_OBBox.h:56