CollisionPairInserterBase.h
Go to the documentation of this file.
00001 /*
00002  * Copyright (c) 2008, AIST, the University of Tokyo and General Robotix Inc.
00003  * All rights reserved. This program is made available under the terms of the
00004  * Eclipse Public License v1.0 which accompanies this distribution, and is
00005  * available at http://www.eclipse.org/legal/epl-v10.html
00006  * Contributors:
00007  * National Institute of Advanced Industrial Science and Technology (AIST)
00008  * General Robotix Inc. 
00009  */
00010 
00011 #ifndef HRPCOLLISION_COLLISION_PAIR_INSERTER_BASE_H_INCLUDED
00012 #define HRPCOLLISION_COLLISION_PAIR_INSERTER_BASE_H_INCLUDED
00013 
00014 #include "CollisionData.h"
00015 #include <boost/intrusive_ptr.hpp>
00016 #include <vector>
00017 
00018 namespace Opcode {
00019 
00020     class AABBCollisionNode;
00021     class MeshInterface;
00022 }
00023     
00024 namespace hrp {
00025     class ColdetModelSharedDataSet;
00026 
00027     class CollisionPairInserterBase
00028     {
00029       public:
00030         virtual ~CollisionPairInserterBase(){}
00034         void clear(){
00035             cdContact.clear();
00036         }
00037 
00050         virtual int detectTriTriOverlap(
00051             const Vector3& P1,
00052             const Vector3& P2,
00053             const Vector3& P3,
00054             const Vector3& Q1,
00055             const Vector3& Q2,
00056             const Vector3& Q3,
00057             collision_data* col_p)=0;
00058 
00077         virtual int apply(const Opcode::AABBCollisionNode* b1,
00078                   const Opcode::AABBCollisionNode* b2,
00079                   int id1, int id2,
00080                   int num_of_i_points,
00081                   Vector3 i_points[4],
00082                   Vector3& n_vector,
00083                   double depth,
00084                   Vector3& n1,
00085                   Vector3& m1,
00086                   int ctype,
00087                   Opcode::MeshInterface* mesh1,
00088                   Opcode::MeshInterface* mesh2)=0;
00089 
00094         std::vector<collision_data>& collisions() {
00095             return cdContact;
00096         }
00097 
00098         void set(ColdetModelSharedDataSet* model0, 
00099                  ColdetModelSharedDataSet* model1){
00100             models[0] = model0;
00101             models[1] = model1;
00102         }
00103 
00104         Matrix33 CD_Rot1;       
00105         Vector3 CD_Trans1;      
00106         double CD_s1;           
00107 
00108         Matrix33 CD_Rot2;       
00109         Vector3 CD_Trans2;      
00110         double CD_s2;           
00111 
00112         std::vector<collision_data> cdContact; 
00113         
00114         ColdetModelSharedDataSet *models[2];
00115     };
00116 }
00117 #endif


openhrp3
Author(s): AIST, General Robotix Inc., Nakamura Lab of Dept. of Mechano Informatics at University of Tokyo
autogenerated on Sun Apr 2 2017 03:43:53