|
| SegmentSelfContact () |
| Constructor. More...
|
|
std::list< std::shared_ptr< Contact > > | calculateCcdContact (const Math::SegmentMeshShape &segmentShape1AtTime0, const Math::RigidTransform3d &segmentPose1AtTime0, const Math::SegmentMeshShape &segmentShape1AtTime1, const Math::RigidTransform3d &segmentPose1AtTime1, const Math::SegmentMeshShape &segmentShape2AtTime0, const Math::RigidTransform3d &segmentPose2AtTime0, const Math::SegmentMeshShape &segmentShape2AtTime1, const Math::RigidTransform3d &segmentPose2AtTime1) const override |
|
void | setTimeMinPrecisionEpsilon (double precision) |
| Set the minimum time precision allowed when deciding on the depth of recursion. More...
|
|
double | getTimeMinPrecisionEpsilon () |
|
void | setTimeMaxPrecisionEpsilon (double precision) |
| Set the maximum time precision allowed when deciding on the depth of recursion. More...
|
|
double | getTimeMaxPrecisionEpsilon () |
|
void | setDistanceEpsilon (double precision) |
| Set the maximum separation for which two points are considered the same. More...
|
|
double | distanceEpsilon () |
|
std::pair< int, int > | getShapeTypes () override |
| Function that returns the shapes between which this class performs collision detection. More...
|
|
| ContactCalculation () |
| Constructor. More...
|
|
virtual | ~ContactCalculation () |
| Destructor. More...
|
|
void | calculateContact (std::shared_ptr< CollisionPair > pair) |
| Calculate the contacts for a given pair. More...
|
|
std::list< std::shared_ptr< Contact > > | calculateDcdContact (const Math::PosedShape< std::shared_ptr< Math::Shape >> posedShape1, const Math::PosedShape< std::shared_ptr< Math::Shape >> posedShape2) |
| Calculate the dcd contacts between two posed/transformed shapes. More...
|
|
std::list< std::shared_ptr< Contact > > | calculateCcdContact (const Math::PosedShapeMotion< std::shared_ptr< Math::Shape >> posedShapeMotion1, const Math::PosedShapeMotion< std::shared_ptr< Math::Shape >> posedShapeMotion2) |
| Calculate the ccd contacts between two posed/transformed shapes. More...
|
|
|
bool | detectCollision (const std::array< SurgSim::Math::Vector3d, 2 > &pt0Positions, const std::array< SurgSim::Math::Vector3d, 2 > &pt1Positions, const std::array< SurgSim::Math::Vector3d, 2 > &qt0Positions, const std::array< SurgSim::Math::Vector3d, 2 > &qt1Positions, double segmentRadius1, double segmentRadius2, double timePrecision, double *r, double *s, double *t, SurgSim::Math::Vector3d *pToQDir, SurgSim::Math::Vector3d *contactPtP, SurgSim::Math::Vector3d *contactPtQ) const |
| Detect if two segments actually collide either at time t=0 (Fixed case) or within a movement phase. More...
|
|
void | getUniqueCandidates (const std::list< SurgSim::DataStructures::AabbTree::TreeNodePairType > &intersectionList, std::set< std::pair< size_t, size_t >> *segmentIds) const |
| Given a list of potentially intersecting AABB nodes, cull the list of any duplicates and return the uniques candidates as synchronized pairs. More...
|
|
bool | removeInvalidCollisions (const Math::SegmentMeshShape &segmentA, const Math::SegmentMeshShape &segmentB, size_t segment1SegID, size_t segment2SegID) const |
| From the initial AABB tree collisions, there are some very simple filtering operations that we can do to eliminate a number of false positives. More...
|
|
bool | detectExcessMovement (const SurgSim::Math::Vector3d &pt0, const SurgSim::Math::Vector3d &pt1, double threshold) const |
| Verify the a given point at times t0 and t1 have remained within a reasonable neighborhood. More...
|
|
bool | findSegSegContact (const Math::SegmentMeshShape &segmentShape, const std::list< std::shared_ptr< Contact >> &contacts, double t, Collision::CollisionDetectionType collisionType, size_t segId1, double s1, size_t segId2, double s2, double timeEpsilon) const |
| Search the list of contacts for a match to the current contact. More...
|
|
bool | isSameSegContactPoint (const Math::SegmentMeshShape &segmentShape, size_t segId1, double s1, size_t segId2, double s2) const |
| Check for the same location among two parametric location specifications. More...
|
|
double | maxTimePrecision (const std::array< SurgSim::Math::Vector3d, 2 > &pt0Positions, const std::array< SurgSim::Math::Vector3d, 2 > &pt1Positions, const std::array< SurgSim::Math::Vector3d, 2 > &qt0Positions, const std::array< SurgSim::Math::Vector3d, 2 > &qt1Positions, double effectiveThickness) const |
| Calculate the maximum time interval that guarantees that all collisions can be detected given the derived motions of the segment end points. More...
|
|
SegmentSelfContact computes the self collisions among a SegmentMesh under motion at two time points parametrized over the time interval [0,1].
An initial phase uses the AABB tree to select a set of potentially colliding segments from the SegmentMesh. For each of these candidate segment pairs, the goal is to determine the point of earliest contact should any exist.
At the highest level the actual collision detection of candidate segment pairs is a two phase algorithm. First determine if there is contact at the start of an interval and report the contact if found. If no contact is found at the start, subdivide the interval, determine which of the resulting candidate subintervals may have collisions, and then recursively check those promising subintervals. Note that a simple algorithm based on interval arithmetic (including the Interval, LinearMotion and Polynomial interval classes) allows for a quick determination of promising subintervals allowing many of the subintervals to be pruned during the subdivision step without forcing the recursion to bottom out.
- See also
- Interval, LinearMotion, Polynomial, SegmentSegmentCcdIntervalCheck
From the initial AABB tree collisions, there are some very simple filtering operations that we can do to eliminate a number of false positives.
Most notably, we do not want to collide a single segment against itself, or against one of the segments with which it shares a vertex. These are trivial collisions and will always be present. Less obvious, we want to filter out segments with wild movement vectors. These segments cannot be appropriately processed and are likely to represent errors.
- Parameters
-
segmentA | the segment mesh at time t=0. |
segmentB | the segment mesh at time t=1. |
segment1SegID | the specific identifier of the candidate segment at time t=0. |
segment2SegID | the specific identifier of the candidate segment at time t=1. |
- Returns
- true if this collision should be discarded, false if it should be processed further.