![]() |
TAPs 0.7.7.3
|
00001 /****************************************************************************** 00002 TAPsColDetSupport.cpp 00003 00004 A Base (Abstract) Collision Detection support. 00005 A Model should be inherited from this class for collision detection support. 00006 00007 SUKITTI PUNAK (04/25/2005) 00008 UPDATE (07/26/2010) 00009 ******************************************************************************/ 00010 #include "TAPsColDetSupport.hpp" 00011 // Using Inclusion Model (i.e. definitions are included in declarations) 00012 // (this name.cpp is included in name.hpp) 00013 // Each friend is defined directly inside its declaration. 00014 00015 BEGIN_NAMESPACE_TAPs 00016 //============================================================================= 00017 //----------------------------------------------------------------------------- 00018 // Default Constructor 00019 template <typename T> 00020 ColDetSupport<T>::ColDetSupport () 00021 : m_pBVHTree( NULL ) 00022 { 00023 #ifdef TAPs_DEBUG_MODE 00024 std::cout << "ColDetSupport<" << typeid(T).name() << "> constructor\n"; 00025 #endif//TAPs_DEBUG_MODE 00026 } 00027 //----------------------------------------------------------------------------- 00028 // Destructor 00029 template <typename T> 00030 ColDetSupport<T>::~ColDetSupport () 00031 { 00032 if ( m_pBVHTree ) delete m_pBVHTree; 00033 00034 #ifdef TAPs_DEBUG_MODE 00035 std::cout << "ColDetSupport<" << typeid(T).name() << "> destructor\n"; 00036 #endif//TAPs_DEBUG_MODE 00037 } 00038 //----------------------------------------------------------------------------- 00039 // Get/Set Fns 00040 template <typename T> 00041 Vector3<T> ColDetSupport<T>::GetBoundingAABBLowPoint () const 00042 { 00043 return m_paBoundingAABB[0]; 00044 } 00045 //----------------------------------------------------------------------------- 00046 template <typename T> 00047 Vector3<T> ColDetSupport<T>::GetBoundingAABBHighPoint () const 00048 { 00049 return m_paBoundingAABB[1]; 00050 } 00051 //----------------------------------------------------------------------------- 00052 template <typename T> 00053 void ColDetSupport<T>::SetBoundingAABBLowPoint ( Vector3<T> pt ) 00054 { 00055 m_paBoundingAABB[0] = pt; 00056 } 00057 //----------------------------------------------------------------------------- 00058 template <typename T> 00059 void ColDetSupport<T>::SetBoundingAABBHighPoint ( Vector3<T> pt ) 00060 { 00061 m_paBoundingAABB[1] = pt; 00062 } 00063 //----------------------------------------------------------------------------- 00064 template <typename T> 00065 Vector3<T> ColDetSupport<T>::GetBoundingEllipsoid () const 00066 { 00067 return m_paBoundingAABB[1]; 00068 } 00069 //----------------------------------------------------------------------------- 00070 template <typename T> 00071 T ColDetSupport<T>::GetBoundingSphere () const 00072 { 00073 return m_pBoundingSphere; 00074 } 00075 //----------------------------------------------------------------------------- 00076 template <typename T> 00077 void ColDetSupport<T>::ClearBVHTree () 00078 { 00079 if ( m_pBVHTree ) { 00080 delete m_pBVHTree; 00081 m_pBVHTree = NULL; 00082 } 00083 } 00084 //----------------------------------------------------------------------------- 00085 //============================================================================= 00086 END_NAMESPACE_TAPs 00087 //----------------------------------------------------------------------------- 00088 //345678901234567890123456789012345678901234567890123456789012345678901234567890 00089 //--+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8