CollisionPairInserterBase.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2008, AIST, the University of Tokyo and General Robotix Inc.
3  * All rights reserved. This program is made available under the terms of the
4  * Eclipse Public License v1.0 which accompanies this distribution, and is
5  * available at http://www.eclipse.org/legal/epl-v10.html
6  * Contributors:
7  * National Institute of Advanced Industrial Science and Technology (AIST)
8  * General Robotix Inc.
9  */
10 
11 #ifndef HRPCOLLISION_COLLISION_PAIR_INSERTER_BASE_H_INCLUDED
12 #define HRPCOLLISION_COLLISION_PAIR_INSERTER_BASE_H_INCLUDED
13 
14 #include "CollisionData.h"
15 #include <boost/intrusive_ptr.hpp>
16 #include <vector>
17 
18 namespace Opcode {
19 
20  class AABBCollisionNode;
21  class MeshInterface;
22 }
23 
24 namespace hrp {
25  class ColdetModelSharedDataSet;
26 
28  {
29  public:
30  CollisionPairInserterBase() : normalVectorCorrection(true) {}
35  void clear(){
36  cdContact.clear();
37  }
38 
51  virtual int detectTriTriOverlap(
52  const Vector3& P1,
53  const Vector3& P2,
54  const Vector3& P3,
55  const Vector3& Q1,
56  const Vector3& Q2,
57  const Vector3& Q3,
58  collision_data* col_p)=0;
59 
78  virtual int apply(const Opcode::AABBCollisionNode* b1,
79  const Opcode::AABBCollisionNode* b2,
80  int id1, int id2,
81  int num_of_i_points,
82  Vector3 i_points[4],
83  Vector3& n_vector,
84  double depth,
85  Vector3& n1,
86  Vector3& m1,
87  int ctype,
88  Opcode::MeshInterface* mesh1,
89  Opcode::MeshInterface* mesh2)=0;
90 
95  std::vector<collision_data>& collisions() {
96  return cdContact;
97  }
98 
99  void set(ColdetModelSharedDataSet* model0,
100  ColdetModelSharedDataSet* model1){
101  models[0] = model0;
102  models[1] = model1;
103  }
104 
107  double CD_s1;
108 
111  double CD_s2;
112 
113  std::vector<collision_data> cdContact;
114 
116 
119  };
120 }
121 #endif
Vector3 CD_Trans1
translation of the first mesh
bool normalVectorCorrection
flag to enable/disable normal vector correction
std::vector< collision_data > & collisions()
get collision information
double CD_s1
scale of the first mesh
Matrix33 CD_Rot2
rotation of the second mesh
Eigen::Vector3d Vector3
Definition: EigenTypes.h:11
Eigen::Matrix3d Matrix33
Definition: EigenTypes.h:12
std::vector< collision_data > cdContact
collision information
void clear()
clear collision information
double CD_s2
scale of the second mesh
Vector3 CD_Trans2
translation of the second mesh
Matrix33 CD_Rot1
rotation of the first mesh


openhrp3
Author(s): AIST, General Robotix Inc., Nakamura Lab of Dept. of Mechano Informatics at University of Tokyo
autogenerated on Sat Apr 13 2019 02:14:20