CollisionPairInserter.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_H_INCLUDED
12 #define HRPCOLLISION_COLLISION_PAIR_INSERTER_H_INCLUDED
13 
15 
16 namespace hrp {
17 
19  {
20  public:
22  virtual ~CollisionPairInserter();
23  virtual int detectTriTriOverlap(
24  const Vector3& P1,
25  const Vector3& P2,
26  const Vector3& P3,
27  const Vector3& Q1,
28  const Vector3& Q2,
29  const Vector3& Q3,
30  collision_data* col_p);
31 
32  virtual int apply(const Opcode::AABBCollisionNode* b1,
33  const Opcode::AABBCollisionNode* b2,
34  int id1, int id2,
35  int num_of_i_points,
36  Vector3 i_points[4],
37  Vector3& n_vector,
38  double depth,
39  Vector3& n1,
40  Vector3& m1,
41  int ctype,
42  Opcode::MeshInterface* mesh1,
43  Opcode::MeshInterface* mesh2);
44 
45 
46  private:
47 
48  class tri
49  {
50  public:
51  int id;
53  };
54 
55  class col_tri
56  {
57  public:
58  int status; // 0: unvisited, 1: visited, 2: included in the convex neighbor
61  };
62 
63  static void copy_tri(col_tri* t1, tri* t2);
64 
65  static void copy_tri(col_tri* t1, col_tri* t2);
66 
67  static void calc_normal_vector(col_tri* t);
68 
69  static int is_convex_neighbor(col_tri* t1, col_tri* t2);
70 
72 
73  int get_triangles_in_convex_neighbor(ColdetModelSharedDataSet* model, int id, col_tri* tri_convex_neighbor, int max_num);
74 
75  void get_triangles_in_convex_neighbor(ColdetModelSharedDataSet* model, int id, col_tri* tri_convex_neighbor, std::vector<int>& map, int& count);
76 
77  void examine_normal_vector(int id1, int id2, int ctype);
78 
79  void check_separability(int id1, int id2, int ctype);
80 
82  Vector3 &signed_distance, col_tri *trp, int nth, int ctype, int obj);
83 
85  Vector3& signed_distance, const Vector3& vert, int nth, int ctype, int obj);
86 
87  void find_signed_distance(Vector3& signed_distance1, ColdetModelSharedDataSet* model0, int id1, int contactIndex, int ctype, int obj);
88 
89  int new_point_test(int k);
90  };
91 }
92 
93 #endif
virtual int detectTriTriOverlap(const Vector3 &P1, const Vector3 &P2, const Vector3 &P3, const Vector3 &Q1, const Vector3 &Q2, const Vector3 &Q3, collision_data *col_p)
detect collsiion between triangles
static void copy_tri(col_tri *t1, tri *t2)
virtual int apply(const Opcode::AABBCollisionNode *b1, const Opcode::AABBCollisionNode *b2, int id1, int id2, int num_of_i_points, Vector3 i_points[4], Vector3 &n_vector, double depth, Vector3 &n1, Vector3 &m1, int ctype, Opcode::MeshInterface *mesh1, Opcode::MeshInterface *mesh2)
refine collision information using neighboring triangls
Eigen::Vector3d Vector3
Definition: EigenTypes.h:11
int get_triangles_in_convex_neighbor(ColdetModelSharedDataSet *model, int id, col_tri *tri_convex_neighbor, int max_num)
static void calc_normal_vector(col_tri *t)
void find_signed_distance(Vector3 &signed_distance, col_tri *trp, int nth, int ctype, int obj)
void check_separability(int id1, int id2, int ctype)
void triangleIndexToPoint(ColdetModelSharedDataSet *model, int id, col_tri &tri)
static int is_convex_neighbor(col_tri *t1, col_tri *t2)
void examine_normal_vector(int id1, int id2, int ctype)


openhrp3
Author(s): AIST, General Robotix Inc., Nakamura Lab of Dept. of Mechano Informatics at University of Tokyo
autogenerated on Thu Sep 8 2022 02:24:02