chrono::collision::ChCollisionPair Class Reference

Description

Class for storing information about a collision point.

#include <ChCCollisionPair.h>

Collaboration diagram for chrono::collision::ChCollisionPair:

Public Member Functions

 ChCollisionPair ()
 Basic constructor.
 
 ChCollisionPair (geometry::ChGeometry *mgeo1, geometry::ChGeometry *mgeo2, const ChVector<> &mp1, const ChVector<> &mp2, const ChVector< float > &mnormal, float *mreaction_cache=0)
 Constructor for case of contact point correctly estimated.
 
 ChCollisionPair (geometry::ChGeometry *mgeo1, geometry::ChGeometry *mgeo2)
 Constructor for case of just intersection.
 
void Set (geometry::ChGeometry *mgeo1, geometry::ChGeometry *mgeo2, const ChVector<> &mp1, const ChVector<> &mp2, const ChVector< float > &mnormal, float *mreaction_cache=0)
 Set all data at once (better: use the custom constructor)
 
void SwapGeometries ()
 Swap geometries, that is geo1 becomes geo2 and viceversa; normal and so on are updates as well. More...
 
void CacheFetchSpeedSolutionFromManifold (float &mN, float &mU, float &mV)
 Fetches normal and U,V impulsive reactions, as previously stored in a persistent contact manifold maintained by the collision engine. More...
 
void CacheFetchPositionSolutionFromManifold (float &mN, float &mU, float &mV)
 Fetches normal and U,V 'positional' reactions, as previously stored in a persistent contact manifold maintained by the collision engine. More...
 
void CacheStoreSpeedSolutionIntoManifold (const float mN, const float mU, const float mV)
 Stores normal and U,V reactions into a persistent contact manifold maintained by the collision engine (if any)
 
void CacheStorePositionSolutionIntoManifold (const float mN, const float mU, const float mV)
 Stores normal and U,V 'positional' reactions into a persistent contact manifold maintained by the collision engine (if any)
 

Public Attributes

geometry::ChGeometrygeo1
 pointer to 1st geometry which generated this collision pair
 
geometry::ChGeometrygeo2
 pointer to 2nd geometry which generated this collision pair
 
ChVector p1
 max penetration point on geo1, after refining, in abs space
 
ChVector p2
 max penetration point on geo2, after refining, in abs space
 
ChVector< float > normal
 normal, on surface of master reference (geo1)
 
double norm_dist
 penetration distance (negative if going inside) after refining
 
bool just_intersection
 if true, only reports that two geometries are intersection, but no info is reliable
 
float * reactions_cache
 about normal, p1 or p2. More...
 

Member Function Documentation

void chrono::collision::ChCollisionPair::CacheFetchPositionSolutionFromManifold ( float &  mN,
float &  mU,
float &  mV 
)

Fetches normal and U,V 'positional' reactions, as previously stored in a persistent contact manifold maintained by the collision engine.

If no cache, set as 0,0,0

void chrono::collision::ChCollisionPair::CacheFetchSpeedSolutionFromManifold ( float &  mN,
float &  mU,
float &  mV 
)

Fetches normal and U,V impulsive reactions, as previously stored in a persistent contact manifold maintained by the collision engine.

If no cache, set as 0,0,0

void chrono::collision::ChCollisionPair::SwapGeometries ( )

Swap geometries, that is geo1 becomes geo2 and viceversa; normal and so on are updates as well.

Member Data Documentation

float* chrono::collision::ChCollisionPair::reactions_cache

about normal, p1 or p2.

points to an array[3] of N,U,V reactions which might be stored in a persistent contact manifold in the collision engine