14 #ifndef HRPCOLLISION_COLDET_MODEL_PAIR_H_INCLUDED
15 #define HRPCOLLISION_COLDET_MODEL_PAIR_H_INCLUDED
17 #define LOCAL_EPSILON 0.0001f
41 IceMaths::Matrix4x4*
transform(
int index) {
return models[index]->transform; }
44 return detectCollisionsSub(
true);
48 return collisionPairInserter->cdContact;
52 collisionPairInserter->cdContact.clear();
56 return !detectCollisionsSub(
false).empty();
59 double computeDistance(
double *point0,
double *point1);
65 double computeDistance(
int& out_triangle0,
double* out_point0,
int& out_triangle1,
double* out_point1);
67 bool detectIntersection();
73 int calculateCentroidIntersection(
float &cx,
float &cy,
float &A,
float radius, std::vector<float> vx, std::vector<float> vy);
75 int makeCCW(std::vector<float> &vx, std::vector<float> &vy);
77 float calculatePolygonArea(
const std::vector<float> &vx,
const std::vector<float> &vy);
78 void calculateSectorCentroid(
float &cx,
float &cy,
float radius,
float th1,
float th2);
81 return sqrt(pow(x, 2) + pow(y, 2)) <= r;
83 bool isInsideTriangle(
float x,
float y,
const std::vector<float> &vx,
const std::vector<float> &vy);
85 int calculateIntersection(std::vector<float> &x, std::vector<float> &y,
float radius,
float x1,
float y1,
float x2,
float y2);
89 collisionPairInserter->normalVectorCorrection =
flag;
92 std::vector<collision_data>& detectCollisionsSub(
bool detectAllContacts);
93 bool detectMeshMeshCollisions(
bool detectAllContacts);
94 bool detectSphereSphereCollisions(
bool detectAllContacts);
95 bool detectSphereMeshCollisions(
bool detectAllContacts);
96 bool detectPlaneCylinderCollisions(
bool detectAllContacts);
97 bool detectPlaneMeshCollisions(
bool detectAllContacts);