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
hrp::CollisionPairInserter::detectTriTriOverlap
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
Definition: CollisionPairInserter.cpp:446
hrp::CollisionPairInserter::tri::p2
Vector3 p2
Definition: CollisionPairInserter.h:52
CollisionPairInserterBase.h
hrp::CollisionPairInserter::col_tri
Definition: CollisionPairInserter.h:55
hrp::CollisionPairInserter::col_tri::p2
Vector3 p2
Definition: CollisionPairInserter.h:59
hrp::CollisionPairInserter::col_tri::status
int status
Definition: CollisionPairInserter.h:58
hrp::CollisionPairInserter::calc_normal_vector
static void calc_normal_vector(col_tri *t)
Definition: CollisionPairInserter.cpp:83
hrp::CollisionPairInserter::new_point_test
int new_point_test(int k)
Definition: CollisionPairInserter.cpp:370
hrp::CollisionPairInserter::get_triangles_in_convex_neighbor
int get_triangles_in_convex_neighbor(ColdetModelSharedDataSet *model, int id, col_tri *tri_convex_neighbor, int max_num)
Definition: CollisionPairInserter.cpp:167
hrp
Definition: ColdetModel.h:28
hrp::CollisionPairInserter::tri::p3
Vector3 p3
Definition: CollisionPairInserter.h:52
hrp::CollisionPairInserter::copy_tri
static void copy_tri(col_tri *t1, tri *t2)
Definition: CollisionPairInserter.cpp:63
hrp::CollisionPairInserter::apply
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
Definition: CollisionPairInserter.cpp:390
hrp::CollisionPairInserter::col_tri::n
Vector3 n
Definition: CollisionPairInserter.h:60
hrp::Vector3
Eigen::Vector3d Vector3
Definition: EigenTypes.h:11
hrp::CollisionPairInserter::CollisionPairInserter
CollisionPairInserter()
Definition: CollisionPairInserter.cpp:51
hrp::CollisionPairInserter::tri
Definition: CollisionPairInserter.h:48
hrp::CollisionPairInserter::tri::id
int id
Definition: CollisionPairInserter.h:51
hrp::ColdetModelSharedDataSet
Definition: ColdetModelSharedDataSet.h:29
hrp::CollisionPairInserter::col_tri::p1
Vector3 p1
Definition: CollisionPairInserter.h:59
hrp::collision_data
Definition: CollisionData.h:20
hrp::CollisionPairInserter::find_signed_distance
void find_signed_distance(Vector3 &signed_distance, col_tri *trp, int nth, int ctype, int obj)
Definition: CollisionPairInserter.cpp:271
viewSimTest.obj
obj
Definition: viewSimTest.py:6
hrp::CollisionPairInserter::is_convex_neighbor
static int is_convex_neighbor(col_tri *t1, col_tri *t2)
Definition: CollisionPairInserter.cpp:94
hrp::CollisionPairInserter::check_separability
void check_separability(int id1, int id2, int ctype)
Definition: CollisionPairInserter.cpp:196
hrp::CollisionPairInserter::~CollisionPairInserter
virtual ~CollisionPairInserter()
Definition: CollisionPairInserter.cpp:57
hrp::CollisionPairInserter
Definition: CollisionPairInserter.h:18
hrp::CollisionPairInserter::tri::p1
Vector3 p1
Definition: CollisionPairInserter.h:52
hrp::CollisionPairInserter::triangleIndexToPoint
void triangleIndexToPoint(ColdetModelSharedDataSet *model, int id, col_tri &tri)
Definition: CollisionPairInserter.cpp:116
hrp::CollisionPairInserter::col_tri::p3
Vector3 p3
Definition: CollisionPairInserter.h:59
hrp::CollisionPairInserterBase
Definition: CollisionPairInserterBase.h:27
hrp::CollisionPairInserter::examine_normal_vector
void examine_normal_vector(int id1, int id2, int ctype)
Definition: CollisionPairInserter.cpp:191


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