00001 #ifndef CD_Linear_h 00002 #define CD_Linear_h 1 00003 00004 #include "CollisionDetectors\CD_Bool.h" 00005 #include "kinematics\Configuration.h" 00006 00007 class Universe; 00008 00009 enum CD_RESULT 00010 { 00011 CD_FREE, //completely in CFree 00012 CD_OBSTACLE, //completely in CObstacle 00013 CD_PARTIAL //paritally in CFree and CObstacle 00014 } ; 00015 00016 00017 class CD_Linear : public CD_Bool //## Inherits: <unnamed>%378A7B240009 00018 { 00019 00020 public: 00021 CD_Linear (const CD_Linear& right); 00022 CD_Linear (const Universe& universe); 00023 virtual ~CD_Linear(); 00024 00025 //gets the stat of how many times this has been called 00026 int GetNumberOfTimesCalledLinear(); 00027 00028 // increments the stats of how many times this collision detector has 00029 // been called 00030 void IncrementLinearStat(); 00031 00032 virtual bool IsInterferingLinear( const Configuration& c1, const Configuration& c2 ) = 0; 00033 virtual bool IsCompletelyWithinObstacles( const Configuration& c1, const Configuration& c2 ) = 0; 00034 virtual CD_RESULT LinearTest( const Configuration& c1, const Configuration& c2 ); 00035 00036 virtual Configuration GetLastIntersection () const; 00037 virtual Configuration GetLastValid () const; 00038 00039 //resets the stats for counting number of times called 00040 void ResetStats(); 00041 00042 // SetUseWrapping: 00043 // Sets the collision detector to use wrapping joints (for every joint capable of wrapping) 00044 // when taking the shortest linear distance between two joints. 00045 void SetUseWrapping( bool wrapping ); 00046 00047 protected: 00048 // Data Members for Class Attributes 00049 Configuration lastIntersection; 00050 Configuration lastValid; 00051 00052 // Indicates if wrapping joints will be used. 00053 bool useWrapping; 00054 00055 int m_StatNumberOfLinearCalls; 00056 00057 private: 00058 private: 00059 }; 00060 00061 #endif