public class ContactData
extends java.lang.Object
Constructor and Description |
---|
ContactData()
Constructs a new, empty ContactConstraintData object.
|
ContactData(ContactConstraint cons,
boolean isBilateral)
Constructs a ContactConstraintData object from the data in a
ContactConstraint . |
Modifier and Type | Method and Description |
---|---|
Vector3d |
getContactForce()
Returns the contact force associated with this contact.
|
double |
getContactForceScalar()
Returns the value of the contact force along the contact normal.
|
ContactPoint |
getContactPoint0()
Returns the first point of this contact.
|
ContactPoint |
getContactPoint1()
Returns the second point of this contact.
|
Vector3d |
getFrictionForce()
Returns the friction force associated with this contact.
|
Vector3d |
getNormal()
Returns the normal associated with this contact.
|
Point3d |
getPosition0()
Returns the position of the first point of this contact, in world
coordinates.
|
Point3d |
getPosition1()
Returns the position of the second point of this contact, in world
coordinates.
|
void |
getState(DataBuffer data)
Saves the information of this ContactContraintData into a data buffer.
|
boolean |
point0OnCollidable1()
Queries whether the first contact point is on the second collidable
of this contact.
|
void |
setState(DataBuffer data,
CollidableBody collidable0,
CollidableBody collidable1)
Loads the information of this ContactContraintData from a data buffer,
using the contact's collidable bodies to supply additional information.
|
public ContactData()
public ContactData(ContactConstraint cons, boolean isBilateral)
ContactConstraint
.cons
- constraint providing the contact dataisBilateral
- if true
, indicates the contact constraint
is bilateralpublic ContactPoint getContactPoint0()
public Point3d getPosition0()
public boolean point0OnCollidable1()
true
, the first point is on the second
collidable and the second point is on the first collidable. This
condition can only occur for collisions using vertex penetration
(see CollisionBehavior.Method
). Otherwise, the first point is on
the first collidable and the second point is on the second collidable.public ContactPoint getContactPoint1()
public Point3d getPosition1()
public double getContactForceScalar()
public Vector3d getContactForce()
lam * nrm
, where lam
and nrm
are the
values returned by getContactForceScalar()
and getNormal()
.public Vector3d getFrictionForce()
public Vector3d getNormal()
getContactPoint0()
), and directed toward the second
contact point (returned by getContactPoint0()
).public void getState(DataBuffer data)
data
- buffer in which to store informationpublic void setState(DataBuffer data, CollidableBody collidable0, CollidableBody collidable1)
data
- buffer from which to get informationcollidable0
- first collidable body associated with this contactcollidable1
- second collidable body associated with this contact