|
| TriangleMesh (const ArrayViewConst_< Vec3 > &vertices, const ArrayViewConst_< int > &faceIndices, bool smooth=false) |
| Create a TriangleMesh. More...
|
|
| TriangleMesh (const PolygonalMesh &mesh, bool smooth=false) |
| Create a TriangleMesh based on a PolygonalMesh object. More...
|
|
int | getNumEdges () const |
| Get the number of edges in the mesh. More...
|
|
int | getNumFaces () const |
| Get the number of faces in the mesh. More...
|
|
int | getNumVertices () const |
| Get the number of vertices in the mesh. More...
|
|
const Vec3 & | getVertexPosition (int index) const |
| Get the position of a vertex in the mesh. More...
|
|
int | getFaceEdge (int face, int edge) const |
| Get the index of one of the edges of a face. More...
|
|
int | getFaceVertex (int face, int vertex) const |
| Get the index of one of the vertices of a face. More...
|
|
int | getEdgeFace (int edge, int face) const |
| Get the index of one of the faces shared by an edge. More...
|
|
int | getEdgeVertex (int edge, int vertex) const |
| Get the index of one of the vertices shared by an edge. More...
|
|
void | findVertexEdges (int vertex, Array_< int > &edges) const |
| Find all edges that intersect a vertex. More...
|
|
const UnitVec3 & | getFaceNormal (int face) const |
| Get the normal vector for a face. More...
|
|
Real | getFaceArea (int face) const |
| Get the area of a face. More...
|
|
Vec3 | findPoint (int face, const Vec2 &uv) const |
| Calculate the location of a point on the surface, in the local frame of the TriangleMesh. More...
|
|
Vec3 | findCentroid (int face) const |
| Calculate the location of a face's centroid, that is, the point uv=(1/3,1/3) which is the average of the three vertex locations. More...
|
|
UnitVec3 | findNormalAtPoint (int face, const Vec2 &uv) const |
| Calculate the normal vector at a point on the surface. More...
|
|
Vec3 | findNearestPoint (const Vec3 &position, bool &inside, UnitVec3 &normal) const |
| Given a point, find the nearest point on the surface of this object. More...
|
|
Vec3 | findNearestPoint (const Vec3 &position, bool &inside, int &face, Vec2 &uv) const |
| Given a point, find the nearest point on the surface of this object. More...
|
|
Vec3 | findNearestPointToFace (const Vec3 &position, int face, Vec2 &uv) const |
| Given a point and a face of this object, find the point of the face that is nearest the given point. More...
|
|
bool | intersectsRay (const Vec3 &origin, const UnitVec3 &direction, Real &distance, UnitVec3 &normal) const |
| Determine whether this mesh intersects a ray, and if so, find the intersection point. More...
|
|
bool | intersectsRay (const Vec3 &origin, const UnitVec3 &direction, Real &distance, int &face, Vec2 &uv) const |
| Determine whether this mesh intersects a ray, and if so, find what face it hit. More...
|
|
OBBTreeNode | getOBBTreeNode () const |
| Get the OBBTreeNode which forms the root of this mesh's Oriented Bounding Box Tree. More...
|
|
PolygonalMesh | createPolygonalMesh () const |
| Generate a PolygonalMesh from this TriangleMesh; useful mostly for debugging because you can create a DecorativeMesh from this and then look at it. More...
|
|
const Impl & | getImpl () const |
| Internal use only. More...
|
|
Impl & | updImpl () |
| Internal use only. More...
|
|
| ContactGeometry () |
| Base class default constructor creates an empty handle. More...
|
|
| ContactGeometry (const ContactGeometry &src) |
| Copy constructor makes a deep copy. More...
|
|
ContactGeometry & | operator= (const ContactGeometry &src) |
| Copy assignment makes a deep copy. More...
|
|
| ~ContactGeometry () |
| Base class destructor deletes the implementation object. Note that this is not virtual; handles should consist of just a pointer to the implementation. More...
|
|
DecorativeGeometry | createDecorativeGeometry () const |
| Generate a DecorativeGeometry that matches the shape of this ContactGeometry. More...
|
|
Vec3 | findNearestPoint (const Vec3 &position, bool &inside, UnitVec3 &normal) const |
| Given a point, find the nearest point on the surface of this object. More...
|
|
Vec3 | projectDownhillToNearestPoint (const Vec3 &pointQ) const |
| Given a query point Q, find the nearest point P on the surface of this object, looking only down the local gradient. More...
|
|
bool | trackSeparationFromLine (const Vec3 &pointOnLine, const UnitVec3 &directionOfLine, const Vec3 &startingGuessForClosestPoint, Vec3 &newClosestPointOnSurface, Vec3 &closestPointOnLine, Real &height) const |
| Track the closest point between this implicit surface and a given line, or the point of deepest penetration if the line intersects the surface. More...
|
|
bool | intersectsRay (const Vec3 &origin, const UnitVec3 &direction, Real &distance, UnitVec3 &normal) const |
| Determine whether this object intersects a ray, and if so, find the intersection point. More...
|
|
void | getBoundingSphere (Vec3 ¢er, Real &radius) const |
| Get a bounding sphere which completely encloses this object. More...
|
|
bool | isSmooth () const |
| Returns true if this is a smooth surface, meaning that it can provide meaningful curvature information and continuous derivatives with respect to its parameterization. More...
|
|
void | calcCurvature (const Vec3 &point, Vec2 &curvature, Rotation &orientation) const |
| Compute the principal curvatures and their directions, and the surface normal, at a given point on a smooth surface. More...
|
|
const Function & | getImplicitFunction () const |
| Our smooth surfaces define a function f(P)=0 that provides an implicit representation of the surface. More...
|
|
Real | calcSurfaceValue (const Vec3 &point) const |
| Calculate the value of the implicit surface function, at a given point. More...
|
|
UnitVec3 | calcSurfaceUnitNormal (const Vec3 &point) const |
| Calculate the implicit surface outward facing unit normal at the given point. More...
|
|
Vec3 | calcSurfaceGradient (const Vec3 &point) const |
| Calculate the gradient of the implicit surface function, at a given point. More...
|
|
Mat33 | calcSurfaceHessian (const Vec3 &point) const |
| Calculate the hessian of the implicit surface function, at a given point. More...
|
|
Real | calcGaussianCurvature (const Vec3 &gradient, const Mat33 &Hessian) const |
| For an implicit surface, return the Gaussian curvature at the point p whose implicit surface function gradient g(p) and Hessian H(p) are supplied. More...
|
|
Real | calcGaussianCurvature (const Vec3 &point) const |
| This signature is for convenience; use the other one to save time if you already have the gradient and Hessian available for this point. More...
|
|
Real | calcSurfaceCurvatureInDirection (const Vec3 &point, const UnitVec3 &direction) const |
| For an implicit surface, return the curvature k of the surface at a given point p in a given direction tp. More...
|
|
bool | isConvex () const |
| Returns true if this surface is known to be convex. More...
|
|
Vec3 | calcSupportPoint (UnitVec3 direction) const |
| Given a direction expressed in the surface's frame S, return the point P on the surface that is the furthest in that direction (or one of those points if there is more than one). More...
|
|
ContactGeometryTypeId | getTypeId () const |
| ContactTrackerSubsystem uses this id for fast identification of specific surface shapes. More...
|
|
| ContactGeometry (ContactGeometryImpl *impl) |
| Internal use only. More...
|
|
bool | isOwnerHandle () const |
| Internal use only. More...
|
|
bool | isEmptyHandle () const |
| Internal use only. More...
|
|
bool | hasImpl () const |
| Internal use only. More...
|
|
const ContactGeometryImpl & | getImpl () const |
| Internal use only. More...
|
|
ContactGeometryImpl & | updImpl () |
| Internal use only. More...
|
|
void | initGeodesic (const Vec3 &xP, const Vec3 &xQ, const Vec3 &xSP, const GeodesicOptions &options, Geodesic &geod) const |
| Given two points, find a geodesic curve connecting them. More...
|
|
void | continueGeodesic (const Vec3 &xP, const Vec3 &xQ, const Geodesic &prevGeod, const GeodesicOptions &options, Geodesic &geod) const |
| Given the current positions of two points P and Q moving on this surface, and the previous geodesic curve G' connecting prior locations P' and Q' of those same two points, return the geodesic G between P and Q that is closest in length to the previous one. More...
|
|
void | makeStraightLineGeodesic (const Vec3 &xP, const Vec3 &xQ, const UnitVec3 &defaultDirectionIfNeeded, const GeodesicOptions &options, Geodesic &geod) const |
| Produce a straight-line approximation to the (presumably short) geodesic between two points on this implicit surface. More...
|
|
void | shootGeodesicInDirectionUntilLengthReached (const Vec3 &xP, const UnitVec3 &tP, const Real &terminatingLength, const GeodesicOptions &options, Geodesic &geod) const |
| Compute a geodesic curve starting at the given point, starting in the given direction, and terminating at the given length. More...
|
|
void | calcGeodesicReverseSensitivity (Geodesic &geodesic, const Vec2 &initSensitivity=Vec2(0, 1)) const |
| Given an already-calculated geodesic on this surface connecting points P and Q, fill in the sensitivity of point P with respect to a change of tangent direction at Q. More...
|
|
void | shootGeodesicInDirectionUntilPlaneHit (const Vec3 &xP, const UnitVec3 &tP, const Plane &terminatingPlane, const GeodesicOptions &options, Geodesic &geod) const |
| Compute a geodesic curve starting at the given point, starting in the given direction, and terminating when it hits the given plane. More...
|
|
void | calcGeodesic (const Vec3 &xP, const Vec3 &xQ, const Vec3 &tPhint, const Vec3 &tQhint, Geodesic &geod) const |
| Utility method to find geodesic between P and Q using split geodesic method with initial shooting directions tPhint and -tQhint. More...
|
|
void | calcGeodesicUsingOrthogonalMethod (const Vec3 &xP, const Vec3 &xQ, const Vec3 &tPhint, Real lengthHint, Geodesic &geod) const |
| Utility method to find geodesic between P and Q using the orthogonal method, with initial direction tPhint and initial length lengthHint. More...
|
|
void | calcGeodesicUsingOrthogonalMethod (const Vec3 &xP, const Vec3 &xQ, Geodesic &geod) const |
| This signature makes a guess at the initial direction and length and then calls the other signature. More...
|
|
Vec2 | calcSplitGeodError (const Vec3 &P, const Vec3 &Q, const UnitVec3 &tP, const UnitVec3 &tQ, Geodesic *geod=0) const |
| Utility method to calculate the "geodesic error" between one geodesic shot from P in the direction tP and another geodesic shot from Q in the direction tQ. More...
|
|
void | shootGeodesicInDirectionUntilLengthReachedAnalytical (const Vec3 &xP, const UnitVec3 &tP, const Real &terminatingLength, const GeodesicOptions &options, Geodesic &geod) const |
| Analytically compute a geodesic curve starting at the given point, starting in the given direction, and terminating at the given length. More...
|
|
void | shootGeodesicInDirectionUntilPlaneHitAnalytical (const Vec3 &xP, const UnitVec3 &tP, const Plane &terminatingPlane, const GeodesicOptions &options, Geodesic &geod) const |
| Analytically compute a geodesic curve starting at the given point, starting in the given direction, and terminating when it hits the given plane. More...
|
|
void | calcGeodesicAnalytical (const Vec3 &xP, const Vec3 &xQ, const Vec3 &tPhint, const Vec3 &tQhint, Geodesic &geod) const |
| Utility method to analytically find geodesic between P and Q with initial shooting directions tPhint and tQhint. More...
|
|
Vec2 | calcSplitGeodErrorAnalytical (const Vec3 &P, const Vec3 &Q, const UnitVec3 &tP, const UnitVec3 &tQ, Geodesic *geod=0) const |
| Utility method to analytically calculate the "geodesic error" between one geodesic shot from P in the direction tP and another geodesic shot from Q in the direction tQ. More...
|
|
const Plane & | getPlane () const |
| Get the plane associated with the geodesic hit plane event handler. More...
|
|
void | setPlane (const Plane &plane) const |
| Set the plane associated with the geodesic hit plane event handler. More...
|
|
const Geodesic & | getGeodP () const |
| Get the geodesic for access by visualizer. More...
|
|
const Geodesic & | getGeodQ () const |
| Get the geodesic for access by visualizer. More...
|
|
const int | getNumGeodesicsShot () const |
| Get the plane associated with the geodesic hit plane event handler. More...
|
|
void | addVizReporter (ScheduledEventReporter *reporter) const |
| Get the plane associated with the geodesic hit plane event handler. More...
|
|
This ContactGeometry subclass represents an arbitrary shape described by a mesh of triangular faces.
The mesh surface must satisfy the following requirements:
- It must be closed, so that any point can unambiguously be classified as either inside or outside.
- It may not intersect itself anywhere, even at a single point.
- It must be an oriented manifold.
- The vertices for each face must be ordered counter-clockwise when viewed from the outside. That is, if v0, v1, and v2 are the locations of the three vertices for a face, the cross product (v1-v0)%(v2-v0) must point outward.
- The length of every edge must be non-zero.
It is your responsibility to ensure that any mesh you create meets these requirements. The constructor will detect many incorrect meshes and signal them by throwing an exception, but it is not guaranteed to detect all possible problems. If a mesh fails to satisfy any of these requirements, the results of calculations performed with it are undefined. For example, collisions involving it might fail to be detected, or contact forces on it might be calculated incorrectly.