Choreonoid  1.5
Classes | Public Member Functions | List of all members
Opcode::StdCollisionPairInserter Class Reference

#include <StdCollisionPairInserter.h>

Inheritance diagram for Opcode::StdCollisionPairInserter:
Opcode::CollisionPairInserter

Public Member Functions

 StdCollisionPairInserter ()
 
virtual ~StdCollisionPairInserter ()
 
virtual int detectTriTriOverlap (const cnoid::Vector3 &P1, const cnoid::Vector3 &P2, const cnoid::Vector3 &P3, const cnoid::Vector3 &Q1, const cnoid::Vector3 &Q2, const cnoid::Vector3 &Q3, cnoid::collision_data *col_p)
 detect collsiion between triangles More...
 
virtual int apply (const Opcode::AABBCollisionNode *b1, const Opcode::AABBCollisionNode *b2, int id1, int id2, int num_of_i_points, cnoid::Vector3 i_points[4], cnoid::Vector3 &n_vector, double depth, cnoid::Vector3 &n1, cnoid::Vector3 &m1, int ctype, Opcode::MeshInterface *mesh1, Opcode::MeshInterface *mesh2)
 refine collision information using neighboring triangls More...
 
- Public Member Functions inherited from Opcode::CollisionPairInserter
virtual ~CollisionPairInserter ()
 
void clear ()
 clear collision information More...
 
std::vector< cnoid::collision_data > & collisions ()
 get collision information More...
 
void set (cnoid::ColdetModelInternalModel *model0, cnoid::ColdetModelInternalModel *model1)
 

Additional Inherited Members

- Public Attributes inherited from Opcode::CollisionPairInserter
cnoid::Matrix3 CD_Rot1
 rotation of the first mesh More...
 
cnoid::Vector3 CD_Trans1
 translation of the first mesh More...
 
double CD_s1
 scale of the first mesh More...
 
cnoid::Matrix3 CD_Rot2
 rotation of the second mesh More...
 
cnoid::Vector3 CD_Trans2
 translation of the second mesh More...
 
double CD_s2
 scale of the second mesh More...
 
std::vector< cnoid::collision_datacdContact
 collision information More...
 
cnoid::ColdetModelInternalModelmodels [2]
 

Constructor & Destructor Documentation

◆ StdCollisionPairInserter()

StdCollisionPairInserter::StdCollisionPairInserter ( )

◆ ~StdCollisionPairInserter()

StdCollisionPairInserter::~StdCollisionPairInserter ( )
virtual

Member Function Documentation

◆ apply()

int StdCollisionPairInserter::apply ( const Opcode::AABBCollisionNode *  b1,
const Opcode::AABBCollisionNode *  b2,
int  id1,
int  id2,
int  num_of_i_points,
cnoid::Vector3  i_points[4],
cnoid::Vector3 n_vector,
double  depth,
cnoid::Vector3 n1,
cnoid::Vector3 m1,
int  ctype,
Opcode::MeshInterface *  mesh1,
Opcode::MeshInterface *  mesh2 
)
virtual

refine collision information using neighboring triangls

Parameters
b1node of the first colliding triangle
b2node of the second colliding triangle
id1id of the first colliding triangle
id2id of the second colliding triangle
num_of_i_pointsthe number of intersecting points
i_pointsintersecting points
n_vectornormal vector of collision
depthpenetration depth
n1normal vector of the first triangle
m1normal vector of the second triangle
ctypecollision type
mesh1mesh which includes the first triangle
mesh2mesh which includes the second triangle
Returns
CD_OK if refined successfully
Note
collision information is expressed in the second mesh coordinates

Implements Opcode::CollisionPairInserter.

◆ detectTriTriOverlap()

int StdCollisionPairInserter::detectTriTriOverlap ( const cnoid::Vector3 P1,
const cnoid::Vector3 P2,
const cnoid::Vector3 P3,
const cnoid::Vector3 Q1,
const cnoid::Vector3 Q2,
const cnoid::Vector3 Q3,
cnoid::collision_data col_p 
)
virtual

detect collsiion between triangles

Parameters
P1the first vertex of the first triangle
P2the second vertex of the first triangle
P3the third vertex of the first triangle
Q1the first vertex of the second triangle
Q2the second vertex of the second triangle
Q3the third vertex of the second triangle
col_pcollision information
Returns
1 if collision is detected, 0 otherwise
Note
all vertices must be represented in the same coordinates

Implements Opcode::CollisionPairInserter.


The documentation for this class was generated from the following files: