Biomechanical Joint Model
 Author: Anderson Maciel

COME_Collide Class Reference

#include <comecollide.h>

Inherits COME.

Inheritance diagram for COME_Collide:

Inheritance graph
[legend]
Collaboration diagram for COME_Collide:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 COME_Collide (COME_Scenario *scene)
 ~COME_Collide ()
void detectContacts ()
bool detectContactsDisplacement ()
void detectContacts (COME_BioStructure *organ1, COME_BioStructure *organ2)
void detectContactsHybrid (COME_BioStructure *organ1, COME_BioStructure *organ2)
bool detectContactsDisplacement (COME_BioStructure *organ1, COME_BioStructure *organ2)
void resetCollisions ()
void treatCollisions ()
void setCollisions1stLevel (int detectionType)
int getNumberOfCollisions () const
vector< COME_CollisiongetCollisions () const
int getCollisions1stLevel () const
bool isNotAlreadyIn (vector< int > group, int part)
double findMinProjection (COME_Vector3D dir, COME_Vertex3D base, COME_Molecule *nearestMol, vector< int > faces, COME_Mesh *mesh)
double findMaxProjection (COME_Vector3D dir, COME_Vertex3D base, COME_Molecule *nearestMol, vector< int > faces, COME_Mesh *mesh)
bool IsInAcceptableRange (COME_Vector3D dir1, COME_Vector3D dir2, COME_Vertex3D base, double maxdir1, double mindir1, double maxDir2, double minDir2, COME_Face *face)
void initializeProximityStructure ()
int addProximities (COME_Mesh *mA, COME_Mesh *mB, double hardSoft)
void updateProximityStructure ()
void geometricResponse ()
void resetProximitiesDisps ()
vector< COME_Proximity > * getProximityStructurePt ()
void updateVelocity (COME_Face *faceB, COME_Vertex3D *objA)
void sphericalSlidingResponse ()
double signedDistance (COME_Face *faceB, COME_Point3D p, COME_Point3D pointOnB, COME_Vector3D normal)
void updatePosition (COME_Face *faceB, COME_Vertex3D *objA, COME_Point3D pointOnB)

Public Attributes

double softhard
long int CONTADIST

Protected Attributes

vector< COME_Collisioncollisions
int collisions1stLevel
vector< COME_2ndPassItemvector2ndPass
vector< COME_ProximityproximityStructure

Detailed Description

This class implements the collision detection and response methods. It is strongly associated with COME_Collision, which in turn, represents a collision and all its properties. Because more than one strategy is impremented to treat collisions, not all attributes and functions of this class are significative at the same time.

Definition at line 60 of file comecollide.h.


Constructor & Destructor Documentation

COME_Collide::COME_Collide COME_Scenario scene  ) 
 

Construction/Destruction

Definition at line 48 of file comecollide.cpp.

References collisions1stLevel, ENVELOPE, COME::flagCollisionTreatment, initializeProximityStructure(), NEIGHBORS, and COME::parent.

Here is the call graph for this function:

COME_Collide::~COME_Collide  ) 
 

Definition at line 60 of file comecollide.cpp.

References collisions.


Member Function Documentation

int COME_Collide::addProximities COME_Mesh mA,
COME_Mesh mB,
double  hardSoft
 

Add to the proximity structure of this Collide the proximities between the two meshes given. All vertices of non-facing triangles are marked as non-colliding. Note that this assumption may not work if one mesh moves a lot such that the facing triangles change of orientation.

uncomment to have only one proximity

Definition at line 1036 of file comecollide.cpp.

References COME_Mesh::getAFacePt(), COME_Mesh::getClosestFaceIndex(), COME_Mesh::getClosestVertexIndex(), COME_Face::getNormalGlobalPosition(), COME::getParent(), COME_Mesh::getVerticesGlobalPt(), COME_Mesh::getVerticesPt(), proximityStructure, and COME_Vector3D::vpDotProduct().

Referenced by initializeProximityStructure().

Here is the call graph for this function:

void COME_Collide::detectContacts COME_BioStructure organ1,
COME_BioStructure organ2
 

This method detect the collision between objects

Definition at line 320 of file comecollide.cpp.

References RAPID_model::AddTri(), RAPID_model::BeginModel(), RAPID_model::EndModel(), COME_Mesh::getAFacePt(), COME_BioStructure::getSurface(), COME_Face::getVertexGlobalPositionPt(), COME_Mesh::getVerticesFaceGlobalPosition(), RAPID_ALL_CONTACTS, RAPID_Collide(), RAPID_contact, RAPID_num_contacts, and COME_Vertex3D::setColor().

Here is the call graph for this function:

void COME_Collide::detectContacts  ) 
 

This method detect the collision between objects

Don't test collisions between two rigit objects

Definition at line 185 of file comecollide.cpp.

References collisions1stLevel, detectContactsHybrid(), ENVELOPE, COME::flagCollisionTreatment, COME_Patient::getPtOrganList(), HYBRID, COME::parent, and resetCollisions().

Here is the call graph for this function:

bool COME_Collide::detectContactsDisplacement COME_BioStructure organ1,
COME_BioStructure organ2
 

This method tests if some point of one organ is inside the other organ Then set for each penetrating vertex a displacement necessary to eliminate the penetration

Set collision colors

Set collision colors

Definition at line 670 of file comecollide.cpp.

References RAPID_model::AddTri(), RAPID_model::BeginModel(), COME_Mesh::getAFacePt(), COME_Face::getCollisionDetectable(), COME_BioStructure::getSurface(), COME_Face::getVertexGlobalPositionPt(), COME_Mesh::getVerticesFaceGlobalPosition(), and COME_Vertex3D::setColor().

Here is the call graph for this function:

bool COME_Collide::detectContactsDisplacement  ) 
 

This method detect the collision between objects

Don't test collisions between two rigit objects

Definition at line 594 of file comecollide.cpp.

References COME_Patient::getPtOrganList(), and COME::parent.

Here is the call graph for this function:

void COME_Collide::detectContactsHybrid COME_BioStructure organ1,
COME_BioStructure organ2
 

This method detect the collision between objects It first check the spheres colliding then add the triangles anchored to those spheres to RAPID objects.

Definition at line 449 of file comecollide.cpp.

References COME_MoleculesTissue::getShape(), and COME_BioStructure::getTissue().

Referenced by detectContacts().

Here is the call graph for this function:

double COME_Collide::findMaxProjection COME_Vector3D  dir,
COME_Vertex3D  base,
COME_Molecule nearestMol,
vector< int >  faces,
COME_Mesh mesh
 

Definition at line 914 of file comecollide.cpp.

References COME_Mesh::getAFacePt(), COME_Face::getNearestMolecule(), COME_Face::getVerticesGlobalPosition(), max, COME_Vector3D::vpDotProduct(), and COME_Vector3D::vpNormalize().

Here is the call graph for this function:

double COME_Collide::findMinProjection COME_Vector3D  dir,
COME_Vertex3D  base,
COME_Molecule nearestMol,
vector< int >  faces,
COME_Mesh mesh
 

Definition at line 939 of file comecollide.cpp.

References COME_Mesh::getAFacePt(), COME_Face::getNearestMolecule(), COME_Face::getVerticesGlobalPosition(), min, COME_Vector3D::vpDotProduct(), and COME_Vector3D::vpNormalize().

Here is the call graph for this function:

void COME_Collide::geometricResponse  ) 
 

Definition at line 1090 of file comecollide.cpp.

References proximityStructure, and updateVelocity().

Here is the call graph for this function:

vector< COME_Collision > COME_Collide::getCollisions  )  const
 

Definition at line 88 of file comecollide.cpp.

References collisions.

int COME_Collide::getCollisions1stLevel  )  const
 

Definition at line 95 of file comecollide.cpp.

References collisions1stLevel.

int COME_Collide::getNumberOfCollisions  )  const
 

Getting

Definition at line 81 of file comecollide.cpp.

References collisions.

vector< COME_Proximity > * COME_Collide::getProximityStructurePt  ) 
 

Definition at line 1084 of file comecollide.cpp.

References proximityStructure.

void COME_Collide::initializeProximityStructure  ) 
 

PROXIMITIES FUNCTIONS /////////////////////////////////////////////////////////////////////////

TEST WITH TWO CARTILAGES

TEST WITH SIMPLE OBECTS

SPHERE WITH BIG FLOOR

LIGAMENT and BONE

LIGAMENT and FEMURCART

Definition at line 989 of file comecollide.cpp.

References addProximities(), COME_Patient::getPtOrganList(), HARD, COME::parent, proximityStructure, SOFT, and softhard.

Referenced by COME_ModelJoint::changedCollisionTreatment(), COME_Collide(), and COME_ModelJoint::fileLoad_scene().

Here is the call graph for this function:

bool COME_Collide::IsInAcceptableRange COME_Vector3D  dir1,
COME_Vector3D  dir2,
COME_Vertex3D  base,
double  maxdir1,
double  mindir1,
double  maxDir2,
double  minDir2,
COME_Face face
 

Definition at line 965 of file comecollide.cpp.

References COME_Face::getVertices(), and COME_Vector3D::vpDotProduct().

Here is the call graph for this function:

bool COME_Collide::isNotAlreadyIn vector< int >  group,
int  part
 

Definition at line 902 of file comecollide.cpp.

void COME_Collide::resetCollisions  ) 
 

Delete the collisions vector.

Definition at line 106 of file comecollide.cpp.

References collisions.

Referenced by detectContacts().

void COME_Collide::resetProximitiesDisps  ) 
 

Definition at line 1099 of file comecollide.cpp.

References proximityStructure.

void COME_Collide::setCollisions1stLevel int  detectionType  ) 
 

Setting

Definition at line 71 of file comecollide.cpp.

References collisions1stLevel.

double COME_Collide::signedDistance COME_Face faceB,
COME_Point3D  p,
COME_Point3D  pointOnB,
COME_Vector3D  normal
 

Returns the distance of the point to the face given. Distance is negative if a penetration occurs.

Definition at line 1206 of file comecollide.cpp.

References COME_Point3D::vpDistance().

Referenced by updateVelocity().

Here is the call graph for this function:

void COME_Collide::sphericalSlidingResponse  ) 
 

HASH FUNCTIONS /////////////////////////////////////////////////////////////////////////

Definition at line 1113 of file comecollide.cpp.

References COME_Patient::getPtOrganList(), and COME::parent.

Here is the call graph for this function:

void COME_Collide::treatCollisions  ) 
 

This method is an alternative to V-Collide/RAPID. It works only for molecules-made objects, but is much faster than the approach of detectContacts method.

Definition at line 120 of file comecollide.cpp.

References COME_Patient::getPtOrganList(), COME_Point3D::getX(), COME_Point3D::getY(), COME_Point3D::getZ(), COME::parent, COME_Vector3D::setVector3D(), and COME_Vector3D::vpNormalize().

Here is the call graph for this function:

void COME_Collide::updatePosition COME_Face faceB,
COME_Vertex3D objA,
COME_Point3D  pointOnB
 

Calculate position update for this ephemerous proximity.

Definition at line 1220 of file comecollide.cpp.

References COME_Vertex3D::addCollisionDisp(), COME_Vertex3D::getVertexAsPoint3D(), COME_Face::getVertexGlobalPositionPt(), and softhard.

Here is the call graph for this function:

void COME_Collide::updateProximityStructure  ) 
 

Definition at line 1070 of file comecollide.cpp.

References proximityStructure.

void COME_Collide::updateVelocity COME_Face faceB,
COME_Vertex3D objA
 

Calculate velocity update for the face and vertex given when needed

Definition at line 1163 of file comecollide.cpp.

References COME_Vertex3D::addVelocityDisp(), COME_Face::getBlendedVelocity(), COME_Vertex3D::getBlendedVelocity(), COME_Face::getClosestPointOnFaceToPoint(), COME_Vertex3D::getNormalGlobalPosition(), COME_Vertex3D::getVertexAsPoint3D(), signedDistance(), softhard, COME::timestepGlobal, COME_Vector3D::vpDotProduct(), COME_Vector3D::vpNormalize(), COME_Point3D::x, COME_Point3D::y, and COME_Point3D::z.

Referenced by geometricResponse().

Here is the call graph for this function:


Member Data Documentation

vector<COME_Collision> COME_Collide::collisions [protected]
 

Definition at line 64 of file comecollide.h.

Referenced by getCollisions(), getNumberOfCollisions(), resetCollisions(), and ~COME_Collide().

int COME_Collide::collisions1stLevel [protected]
 

Definition at line 65 of file comecollide.h.

Referenced by COME_Collide(), detectContacts(), getCollisions1stLevel(), and setCollisions1stLevel().

long int COME_Collide::CONTADIST
 

Definition at line 107 of file comecollide.h.

vector<COME_Proximity> COME_Collide::proximityStructure [protected]
 

Definition at line 68 of file comecollide.h.

Referenced by addProximities(), geometricResponse(), getProximityStructurePt(), initializeProximityStructure(), resetProximitiesDisps(), and updateProximityStructure().

double COME_Collide::softhard
 

Definition at line 105 of file comecollide.h.

Referenced by initializeProximityStructure(), updatePosition(), and updateVelocity().

vector<COME_2ndPassItem> COME_Collide::vector2ndPass [protected]
 

Definition at line 66 of file comecollide.h.


The documentation for this class was generated from the following files:
Generated on Thu Dec 1 10:14:18 2005 for COME - Biomechanical Joint Model by  doxygen 1.4.5