![]() |
TAPs 0.7.7.3
|
00001 /****************************************************************************** 00002 TAPsCDFnsForRooms.cpp 00003 SUKITTI PUNAK (08/30/2010) 00004 UPDATE (09/07/2010) 00005 ******************************************************************************/ 00006 #include "TAPsCDFnsForRooms.hpp" 00007 // Using Inclusion Model (i.e. definitions are included in declarations) 00008 // (this name.cpp is included in name.hpp) 00009 // Each friend is defined directly inside its declaration. 00010 00011 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 00012 00013 BEGIN_NAMESPACE_TAPs__CD__Fn 00014 //============================================================================= 00015 //----------------------------------------------------------------------------- 00016 00017 00018 #if ( defined TAPs_ROOM_BASIC_HPP && defined TAPs_BOUNDING_VOLUME_HPP ) 00019 //----------------------------------------------------------------------------- 00020 //----------------------------------------------------------------------------- 00021 #endif//#if ( defined TAPs_ROOM_BASIC_HPP && defined TAPs_BOUNDING_VOLUME_HPP ) 00022 00023 00024 00025 #if ( defined TAPs_ROOM_BASIC_HPP && defined TAPs_BOUNDING_VOLUME_HPP ) 00026 //============================================================================= 00027 //----------------------------------------------------------------------------- 00028 template <typename T> 00029 bool CD_RoomBasic_with_BoundingVolume ( 00030 RoomBasic<T> * const pRoom, 00031 BoundingVolume<T> * const pBV, 00032 std::vector< PointForce<T> > & ListOfPointForces, 00033 TransformationSupport<T> * const pTrx_Room, 00034 TransformationSupport<T> * const pTrx_BV 00035 ) 00036 { 00037 ListOfPointForces.clear(); 00038 bool bResult = false; 00039 00040 //--------------------------------------------------------------- 00041 // For transforming the BV to world space 00042 TransformationSupport<T> BV_Trx; 00043 // pTrx_BV, if the extra transformation support is provided 00044 if ( pTrx_BV ) { 00045 BV_Trx.RefToMatrixTransform() *= pTrx_BV->GetMatrixTransform(); 00046 } 00047 // BV's transformation support 00048 BV_Trx.RefToMatrixTransform() *= pBV->GetTransform().GetMatrixTransform(); 00049 00050 //--------------------------------------------------------------- 00051 // For transforming the basic room to world space 00052 TransformationSupport<T> Room_Trx; 00053 // pTrx_Room, if the extra transformation support is provided 00054 if ( pTrx_Room ) { 00055 Room_Trx.RefToMatrixTransform() *= pTrx_Room->GetMatrixTransform(); 00056 } 00057 00058 //--------------------------------------------------------------- 00059 // Detect collision 00060 switch ( pBV->GetType() ) { 00061 case Enum::BOUNDING_SPHERE: 00062 { 00063 Vector3<T> center( BV_Trx * pBV->GetCenter() ); 00064 T radius = pBV->GetRadius(); 00065 } 00066 break; 00067 case Enum::BOUNDING_CYLINDER: 00068 break; 00069 case Enum::BOUNDING_BOX: 00070 break; 00071 case Enum::BOUNDING_ELLIPSOID: 00072 case Enum::BOUNDING_HALF_SPHERE: 00073 case Enum::BOUNDING_HALF_ELLIPSOID: 00074 case Enum::BOUNDING_CONE: 00075 case Enum::BOUNDING_CAPSULE: 00076 case Enum::BOUNDING_POLYTOPE: 00077 PrtNotImplementedYet( "CD_RoomBasic_with_BoundingVolume(...) for a specific case" ); 00078 break; 00079 default: 00080 PrtErrorWithFileNameAndLineNumber( "CD_RoomBasic_with_BoundingVolume(...) -- reach default case" ); 00081 assert( false ); 00082 break; 00083 } 00084 } 00085 // END: CD_IPGroup_with_BoundingVolume(...) 00086 //----------------------------------------------------------------------------- 00087 //============================================================================= 00088 #endif//#if ( defined TAPs_ROOM_BASIC_HPP && defined TAPs_BOUNDING_VOLUME_HPP ) 00089 00090 00091 00092 00093 #if ( defined TAPs_ROOM_BASIC_HPP && defined TAPs_MULTI_BOUNDING_VOLUME_HPP ) 00094 //============================================================================= 00095 //----------------------------------------------------------------------------- 00096 template <typename T> 00097 bool CD_RoomBasic_with_MultiBoundingVolume ( 00098 RoomBasic<T> * const pRoom, 00099 MultiBoundingVolume<T> * const pMBV, 00100 std::vector< PointForce<T> > & ListOfPointForces, 00101 TransformationSupport<T> * const pTrx_Room, 00102 TransformationSupport<T> * const pTrx_MBV 00103 ) 00104 { 00105 ListOfPointForces.clear(); 00106 bool bResult = false; 00107 00108 PrtNotImplementedYet( "CD_IPGroup_with_MultiBoundingVolume(..)" ); 00109 00110 return bResult; 00111 00112 } 00113 // END: CD_IPGroup_with_MultiBoundingVolume(...) 00114 //----------------------------------------------------------------------------- 00115 //============================================================================= 00116 #endif//#if ( defined TAPs_ROOM_BASIC_HPP && defined TAPs_MULTI_BOUNDING_VOLUME_HPP ) 00117 00118 00119 00120 //----------------------------------------------------------------------------- 00121 //============================================================================= 00122 END_NAMESPACE_TAPs__CD__Fn 00123 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 00124 //34567890123456789012345678901234567890123456789012345678901234567890123456789 00125 //--+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----