public class ContactPoint extends java.lang.Object implements MeshFieldPoint
Constructor and Description |
---|
ContactPoint() |
ContactPoint(ContactPoint cpnt) |
ContactPoint(Point3d pnt) |
ContactPoint(Point3d pnt,
Face face,
Vector2d coords) |
ContactPoint(Point3d pnt,
HalfEdge he,
double w1) |
ContactPoint(Vertex3d vtx) |
Modifier and Type | Method and Description |
---|---|
double |
computeContactArea(Vector3d nrml)
Computes an estimate of the local contact for this point, assuming that
it is associated with a vertex or edge-edge contact.
|
boolean |
equals(java.lang.Object obj)
Queries whether this contact point equals another object, based on
equality of the vertices.
|
MeshBase |
getMesh()
Returns the mesh of the first vertex associated with this contact point,
or
null if there are no vertices. |
Point3d |
getPosition()
Returns the position of this contact point, in world coordinates.
|
static void |
getState(DataBuffer data,
ContactPoint cpnt)
Save the information of contact point
cpnt into a data buffer. |
Vertex3d[] |
getVertices()
Returns the mesh vertices associated with this contact, if any.
|
double[] |
getWeights()
Returns the mesh vertex weight associated with this contact, if any.
|
int |
hashCode()
Returns a hash code for this contact point.
|
int |
numVertices()
Returns the number of mesh vertices associated with this contact, or 0 if
there are no vertices.
|
void |
set(ContactPoint cpnt)
Sets this contact point to be identical to another contact point.
|
void |
set(Point3d pnt)
Sets this contact point to correspond to a specific position in world
coordinates, with no mesh vertices.
|
void |
set(Point3d pnt,
Face face,
Vector2d coords)
Sets this contact point to correspond to point on a mesh face, with
specified barycentric coordinates.
|
void |
set(Point3d pnt,
HalfEdge he,
double w1)
Sets this contact point to correspond to a point on a mesh half edge.
|
void |
set(Vertex3d vtx)
Sets this contact point to correspond to a single mesh vertex.
|
static ContactPoint |
setState(DataBuffer data,
PolygonalMesh mesh)
Creates a contact point for information stored in a data buffer, using
additional information supplied by the point's collision mesh.
|
java.lang.String |
toString(java.lang.String fmtStr)
Produces a string representation of this contact point, giving the
position and vertex indices.
|
boolean |
verticesEqual(ContactPoint pnt)
Queries the vertices associated with this contact point equal those of
another.
|
public ContactPoint()
public ContactPoint(Point3d pnt)
public ContactPoint(Vertex3d vtx)
public ContactPoint(ContactPoint cpnt)
public Point3d getPosition()
getPosition
in interface MeshFieldPoint
public Vertex3d[] getVertices()
getVertices
in interface MeshFieldPoint
public int numVertices()
numVertices
in interface MeshFieldPoint
public double[] getWeights()
null
.getWeights
in interface MeshFieldPoint
null
. Should not be modified.public void set(Point3d pnt)
public void set(Vertex3d vtx)
public void set(ContactPoint cpnt)
public void set(Point3d pnt, Face face, Vector2d coords)
public void set(Point3d pnt, HalfEdge he, double w1)
public static void getState(DataBuffer data, ContactPoint cpnt)
cpnt
into a data buffer.public static ContactPoint setState(DataBuffer data, PolygonalMesh mesh)
public int hashCode()
hashCode
in class java.lang.Object
public boolean verticesEqual(ContactPoint pnt)
pnt
- contact point to which vertices are comparedtrue
if this point's vertices equal those of pnt
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
obj
- object to which this contact point is comparedtrue
if obj
is a contact point whose vertices
equal those of this pointpublic MeshBase getMesh()
null
if there are no vertices.public double computeContactArea(Vector3d nrml)
nrml
- contact normalpublic java.lang.String toString(java.lang.String fmtStr)
fmtStr
- numeric format for the position information