#include <collision_detectors.h>
Public Types | |
| enum | DetectorType { DT_AABB, DT_Triangle, DT_Triangle_Distance } |
| Types of possible collision detectors. More... | |
Static Public Member Functions | |
| static CollisionReport | DetectCollision (void *pNode1, void *pNode2, DetectorType type) |
| static Collison_Detector_IFace * | GetColisionDetector (DetectorType type) |
Definition at line 32 of file collision_detectors.h.
Types of possible collision detectors.
Definition at line 36 of file collision_detectors.h.
00037 { 00038 DT_AABB,DT_Triangle, DT_Triangle_Distance 00039 };
| CollisionReport CollisionDetector::DetectCollision | ( | void * | pNode1, | |
| void * | pNode2, | |||
| DetectorType | type | |||
| ) | [static] |
Detect collision from 2 objects and type of collision detectors to use
| [in] | object | 1 |
| [in] | object | 2 |
| [in] | type | of collision detector to use |
Definition at line 17 of file collision_detectors.cpp.
00018 { 00019 CollisionReport collisionReport; 00020 00021 Collison_Detector_IFace* pDetector = GetColisionDetector(type); 00022 00023 if (pDetector) 00024 { 00025 collisionReport = pDetector->FindCollision(pNode1, pNode2); 00026 delete pDetector; 00027 } 00028 00029 return collisionReport; 00030 }
| Collison_Detector_IFace * CollisionDetector::GetColisionDetector | ( | DetectorType | type | ) | [static] |
Get collision detector from type
| [in] | type | of collision detector to get |
Definition at line 34 of file collision_detectors.cpp.
00035 { 00036 Collison_Detector_IFace* pDetector = 0; 00037 00038 switch(type) 00039 { 00040 case DT_AABB: 00041 pDetector = new Collision_detector_AABB(); 00042 break; 00043 case DT_Triangle: 00044 pDetector = new Collision_detector_Triangles(); 00045 break; 00046 case DT_Triangle_Distance: 00047 pDetector = new Collision_detector_Triangles_Distance(); 00048 break; 00049 default: 00050 ;//LOG(wxT("No collision detected for this type")); 00051 } 00052 00053 return pDetector; 00054 }
1.5.5