Choreonoid  1.8
CollisionPairInserter.h
Go to the documentation of this file.
1 
2 #ifndef CNOID_AIST_COLLISION_DETECTOR_COLLISION_PAIR_INSERTER_H
3 #define CNOID_AIST_COLLISION_DETECTOR_COLLISION_PAIR_INSERTER_H
4 
5 #include "CollisionData.h"
6 #include <vector>
7 
8 namespace cnoid {
9 class ColdetModelInternalModel;
10 }
11 
12 namespace Opcode {
13 
14 class AABBCollisionNode;
15 class MeshInterface;
16 
17 class CollisionPairInserter
18 {
19 public:
20  virtual ~CollisionPairInserter(){}
24  void clear(){
25  cdContact.clear();
26  }
27 
40  virtual int detectTriTriOverlap(
41  const cnoid::Vector3& P1,
42  const cnoid::Vector3& P2,
43  const cnoid::Vector3& P3,
44  const cnoid::Vector3& Q1,
45  const cnoid::Vector3& Q2,
46  const cnoid::Vector3& Q3,
47  cnoid::collision_data* col_p)=0;
48 
67  virtual int apply(const Opcode::AABBCollisionNode* b1,
68  const Opcode::AABBCollisionNode* b2,
69  int id1, int id2,
70  int num_of_i_points,
71  cnoid::Vector3 i_points[4],
72  cnoid::Vector3& n_vector,
73  double depth,
74  cnoid::Vector3& n1,
75  cnoid::Vector3& m1,
76  int ctype,
77  Opcode::MeshInterface* mesh1,
78  Opcode::MeshInterface* mesh2)=0;
79 
84  std::vector<cnoid::collision_data>& collisions() {
85  return cdContact;
86  }
87 
88  void set(cnoid::ColdetModelInternalModel* model0,
90  models[0] = model0;
91  models[1] = model1;
92  }
93 
94  cnoid::Matrix3 CD_Rot1;
95  cnoid::Vector3 CD_Trans1;
96  double CD_s1;
97 
98  cnoid::Matrix3 CD_Rot2;
99  cnoid::Vector3 CD_Trans2;
100  double CD_s2;
101 
102  std::vector<cnoid::collision_data> cdContact;
103 
105 };
106 
107 }
108 
109 #endif
cnoid::Vector3
Eigen::Vector3d Vector3
Definition: EigenTypes.h:57
CollisionData.h
cnoid::Matrix3
Eigen::Matrix3d Matrix3
Definition: EigenTypes.h:56
cnoid::ColdetModelInternalModel
Definition: ColdetModelInternalModel.h:14
cnoid
Definition: AbstractSceneLoader.h:11
cnoid::collision_data
Definition: CollisionData.h:16