public class ContactInfo
extends java.lang.Object
getContacts
method of
AbstractCollider
. This information includes the interpenetrating
vertices of mesh, and the contact regions formed from matching
interpenetration zones. Contact information produced by
SurfaceMeshCollider
also includes the intersection
contours and interpenetration regions on each mesh.
Contact information can be used to produce dynamic constraints for handling the contact.
Constructor and Description |
---|
ContactInfo(PolygonalMesh m0,
PolygonalMesh m1) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(ContactInfo cinfo,
java.lang.StringBuilder msg) |
java.util.HashMap<PenetrationRegion,PenetrationRegion> |
findMatchingRegions()
Finds the penetration regions on each mesh that correspond to each other,
in terms of sharing the same intersection contours.
|
java.util.ArrayList<ContactPlane> |
getContactPlanes()
Returns a set of contact planes for this contact.
|
double |
getContactPlaneTol()
Returns the tolerance used to compute contact planes.
|
java.util.ArrayList<IntersectionContour> |
getContours()
Returns the intersection contours associated with this contact.
|
void |
getContourState(DataBuffer state,
java.util.ArrayList<IntersectionContour> contours) |
java.util.ArrayList<EdgeEdgeContact> |
getEdgeEdgeContacts()
Returns the edge-edge contacts for this contact.
|
java.util.ArrayList<TriTriIntersection> |
getIntersections()
Returns the triangle intersections for this contact.
|
PolygonalMesh |
getMesh(int meshNum)
Returns the first or second mesh associated with this contact
information, as indicated by
meshNum , which should be either
0 or 1. |
java.util.ArrayList<PenetratingPoint> |
getPenetratingPoints(int meshNum)
Returns the penetrating points of the mesh indicated by
meshNum (which should be 0 or 1). |
double |
getPointTol()
Returns the nearest point tolerance used to compute contact planes.
|
java.util.ArrayList<PenetrationRegion> |
getRegions(int meshNum)
Returns the contact penetration regions associated with the mesh
indicated by
meshNum (which should be 0 or 1). |
SurfaceMeshIntersector.RegionType |
getRegionsType(int meshNum)
Returns which type of penetration regions (inside, outside, or none) have
been computed for the mesh indicated by
meshNum (which
should be 0 or 1). |
void |
getState(DataBuffer state) |
int |
numContourPoints() |
int |
numContours()
Returns the number of intersection contours associated with this contact.
|
void |
setContactPlaneTol(double tol)
Sets the tolerance used to compute contact planes.
|
java.util.ArrayList<IntersectionContour> |
setContourState(DataBuffer state) |
void |
setEdgeEdgeContacts(java.util.ArrayList<EdgeEdgeContact> contacts)
Directly set edge-edge contacts for the contact.
|
void |
setPenetratingPoints(java.util.ArrayList<PenetratingPoint> points,
int meshNum)
Directly set the penetrating points for the indicated mesh.
|
void |
setPointTol(double tol)
Sets the nearest point tolerance used to compute contact planes.
|
void |
setState(DataBuffer state) |
public ContactInfo(PolygonalMesh m0, PolygonalMesh m1)
public PolygonalMesh getMesh(int meshNum)
meshNum
, which should be either
0 or 1.meshNum
- number of the requested mesh (0 or 1)meshNum
public void setPointTol(double tol)
tol
- nearest point tolerancepublic double getPointTol()
public void setContactPlaneTol(double tol)
tol
- contact plane tolerancepublic double getContactPlaneTol()
public java.util.ArrayList<PenetrationRegion> getRegions(int meshNum)
meshNum
(which should be 0 or 1). Each region
represents a connected subset of the indicated mesh that is either
"inside" or "outside" the other mesh. If the collider that produced this
contact information is not capable of computing penetration regions,
or if no regions were requested, null
is returned.
At present, only SurfaceMeshCollider
can
compute penetration regions.meshNum
- number of the indicated mesh (0 or 1)null
if this information is not available.
Should not
be modified.public SurfaceMeshIntersector.RegionType getRegionsType(int meshNum)
meshNum
(which
should be 0 or 1). The regions themselves are returned by getRegions(int)
. If the collider that produced this contact
information is not capable of computing penetration regions,
or if no regions were requested for the mesh in question,
SurfaceMeshIntersector.RegionType.NONE
is returned. At present, only SurfaceMeshCollider
can compute penetration regions.meshNum
- number of the indicated mesh (0 or 1)Regions.NONE
if there are none.public java.util.ArrayList<IntersectionContour> getContours()
null
is returned. At
present, only SurfaceMeshCollider
can compute contours.null
if
they are not available. Should not be modified.public int numContours()
0
is returned. At
present, only SurfaceMeshCollider
can compute contours.0
if
they are not available.public void setPenetratingPoints(java.util.ArrayList<PenetratingPoint> points, int meshNum)
points
is not
copied. For internal use only.public java.util.ArrayList<PenetratingPoint> getPenetratingPoints(int meshNum)
meshNum
(which should be 0 or 1). These represent all the
vertices of the indicated mesh that are "inside" the other mesh, along
with the corresponding nearest face on the other mesh. The penetrating
points can be used to produce vertex-based contact constraints.
This method computes the penetration points on demand and then caches the result.
meshNum
- number of the indicated mesh (0 or 1)public java.util.ArrayList<ContactPlane> getContactPlanes()
Contact planes are typically used for handling rigid body contact, and their computation depends on the collider used for determining the contact information. If no suitable penetration zones are found between the meshes, no contact planes will be produced.
The method computes contact planes on demand and then caches the result.
public java.util.HashMap<PenetrationRegion,PenetrationRegion> findMatchingRegions()
null
is returned. At present, only SurfaceMeshCollider
can compute penetration regions.null
if penetration
regions are not available.public void setEdgeEdgeContacts(java.util.ArrayList<EdgeEdgeContact> contacts)
contacts
is not copied. For
internal use only.public java.util.ArrayList<EdgeEdgeContact> getEdgeEdgeContacts()
null
is returned. At present, only SurfaceMeshCollider
can compute edge-edge contacts.
The method computes the contacts on demand and then caches the result.
null
if this
information is not available. Should not be modified.public java.util.ArrayList<TriTriIntersection> getIntersections()
null
is returned. At present, only
MeshCollider
produces triangle intersections.null
if
unavailable.public int numContourPoints()
public void getContourState(DataBuffer state, java.util.ArrayList<IntersectionContour> contours)
public java.util.ArrayList<IntersectionContour> setContourState(DataBuffer state)
public void getState(DataBuffer state)
public void setState(DataBuffer state)
public boolean equals(ContactInfo cinfo, java.lang.StringBuilder msg)