5 #ifndef CNOID_AIST_COLLIDION_DETECTOR_COLDET_MODEL_PAIR_H
6 #define CNOID_AIST_COLLIDION_DETECTOR_COLDET_MODEL_PAIR_H
11 #include "exportdecl.h"
29 return detectCollisionsSub(
true);
33 return collisionPairInserter->cdContact;
37 collisionPairInserter->cdContact.clear();
41 return !detectCollisionsSub(
false).empty();
45 double computeDistance(
double* point0,
double* point1);
51 double computeDistance(
int& out_triangle0,
double* out_point0,
int& out_triangle1,
double* out_point1);
53 bool detectIntersection();
58 tolerance_ = tolerance;
61 void setCollisionPairInserter(Opcode::CollisionPairInserter *inserter);
63 int calculateCentroidIntersection(
float &cx,
float &cy,
float &A,
float radius, std::vector<float> vx, std::vector<float> vy);
65 int makeCCW(std::vector<float> &vx, std::vector<float> &vy);
67 float calculatePolygonArea(
const std::vector<float> &vx,
const std::vector<float> &vy);
68 void calculateSectorCentroid(
float &cx,
float &cy,
float radius,
float th1,
float th2);
71 return sqrt(pow(x, 2) + pow(y, 2)) <= r;
73 bool isInsideTriangle(
float x,
float y,
const std::vector<float> &vx,
const std::vector<float> &vy);
75 int calculateIntersection(std::vector<float> &x, std::vector<float> &y,
float radius,
float x1,
float y1,
float x2,
float y2);
79 std::vector<collision_data>& detectCollisionsSub(
bool detectAllContacts);
80 bool detectMeshMeshCollisions(
bool detectAllContacts);
81 bool detectSphereSphereCollisions(
bool detectAllContacts);
82 bool detectSphereMeshCollisions(
bool detectAllContacts);
83 bool detectPlaneCylinderCollisions(
bool detectAllContacts);
84 bool detectPlaneMeshCollisions(
bool detectAllContacts);
88 Opcode::CollisionPairInserter* collisionPairInserter;