/opt/ros/diamondback/stacks/graspit_simulator/graspit/graspit_source/include/triangle.h File Reference

#include <vector>
#include "matvec3D.h"
#include "mytools.h"
Include dependency graph for triangle.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  Triangle

Functions

INLINE_RELEASE position closestPtTriangle (const Triangle &t, const position &p)
INLINE_RELEASE bool triangleIntersection (const Triangle &t1, const Triangle &t2)
INLINE_RELEASE int triangleTriangleContact (const Triangle &t1, const Triangle &t2, double threshSq, std::vector< std::pair< position, position > > *contactPoints)
 Returns all the points on the two triangles separated by less than the threshold.
INLINE_RELEASE double triangleTriangleDistanceSq (const Triangle &t1, const Triangle &t2, position &p1, position &p2)
 Returns the distance between the triangles as well as the two closest points on them.

Function Documentation

INLINE_RELEASE position closestPtTriangle ( const Triangle t,
const position p 
)

Code from REAL-TIME COLLISION DETECTION by Christer Ericson, published by Elsevier.

Definition at line 148 of file triangle_inl.h.

INLINE_RELEASE bool triangleIntersection ( const Triangle t1,
const Triangle t2 
)

Definition at line 70 of file triangle_inl.h.

INLINE_RELEASE int triangleTriangleContact ( const Triangle t1,
const Triangle t2,
double  threshSq,
std::vector< std::pair< position, position > > *  contactPoints 
)

Returns all the points on the two triangles separated by less than the threshold.

Does all 6 vertex-face tests and all 9 edge-edge tests and adds to the report all distinct pairs of resulting points separated by less than the threshold. Returns the number of contact points, 0 if the triangles are not in contact and -1 if the triangles are in collision.

I have not tested all the obscure cases, and it seems that more involved collision detection engines put more intelligence into this. There might be strange (or degenerate) pieces of geometry where this had an unexpected result.

Definition at line 284 of file triangle_inl.h.

INLINE_RELEASE double triangleTriangleDistanceSq ( const Triangle t1,
const Triangle t2,
position p1,
position p2 
)

Returns the distance between the triangles as well as the two closest points on them.

Definition at line 405 of file triangle_inl.h.

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines


graspit
Author(s):
autogenerated on Wed Jan 25 10:59:19 2012