public class CollisionHandler extends ConstrainerBase implements HasRenderProps, GLRenderable
HasAuxState.StateContext
ModelComponent.NavpanelVisibility
Modifier and Type | Field and Description |
---|---|
static boolean |
computeTimings |
static boolean |
doBodyFaceContact |
static PropertyList |
myProps |
boolean |
reduceConstraints |
static boolean |
useSignedDistanceCollider |
enforceUniqueCompositeNames, enforceUniqueNames, myNumber, NULL_OBJ, useCompactPathNames
TRANSLUCENT, TWO_DIMENSIONAL
Constructor and Description |
---|
CollisionHandler(CollisionManager manager) |
CollisionHandler(CollisionManager manager,
CollidableBody col0,
CollidableBody col1,
CollisionBehavior behav) |
Modifier and Type | Method and Description |
---|---|
int |
addBilateralConstraints(SparseBlockMatrix GT,
VectorNd dg,
int numb) |
int |
addFrictionConstraints(SparseBlockMatrix DT,
MechSystem.FrictionInfo[] finfo,
int numf) |
int |
addUnilateralConstraints(SparseBlockMatrix NT,
VectorNd dn,
int numu) |
static boolean |
attachedNearContact(ContactPoint cpnt,
Collidable collidable,
java.util.Set<Vertex3d> attachedVertices) |
void |
autoComputeCompliance(double acc,
double tol)
automatically compute compliance and damping for a given
penetration tolerance and acceleration.
|
void |
clearContactActivity() |
double |
computeCollisionConstraints(double t) |
RenderProps |
createRenderProps()
Factory method to create render properties appropriate to this object.
|
PropertyList |
getAllPropertyInfo()
Returns a list giving static information about all properties exported by
this object.
|
void |
getAuxState(DataBuffer data)
Saves state information for this component by adding data to the
supplied DataBuffer.
|
void |
getBilateralConstraints(java.util.List<ContactConstraint> list) |
int |
getBilateralImpulses(VectorNd lam,
int idx) |
int |
getBilateralInfo(MechSystem.ConstraintInfo[] ginfo,
int idx) |
void |
getBilateralSizes(VectorNi sizes) |
double |
getCompliance() |
ContactConstraint |
getContact(java.util.HashMap<ContactPoint,ContactConstraint> contacts,
ContactPoint cpnt0,
ContactPoint cpnt1,
boolean hashUsingFace,
double distance) |
java.util.Map<Vertex3d,Vector3d> |
getContactImpulses(CollidableBody colA) |
double |
getDamping() |
double |
getFriction()
Returns the coefficient of friction for this collision pair.
|
void |
getInitialAuxState(DataBuffer newData,
DataBuffer oldData)
Saves initial state information data for this component by adding data
to the supplied data buffer.
|
double |
getPenetrationTol() |
ContactInfo |
getRenderContactInfo()
Get most recent ContactInfo info, for rendering purposes.
|
double |
getRigidPointTolerance() |
double |
getRigidRegionTolerance() |
int |
getUnilateralImpulses(VectorNd the,
int idx) |
int |
getUnilateralInfo(MechSystem.ConstraintInfo[] ninfo,
int idx) |
void |
getUnilateralSizes(VectorNi sizes) |
boolean |
isDrawIntersectionContours() |
boolean |
isDrawIntersectionFaces() |
boolean |
isDrawIntersectionPoints() |
boolean |
isReduceConstraints() |
int |
maxFrictionConstraintSets() |
int |
numBilateralConstraints() |
int |
numUnilateralConstraints() |
void |
prerender(RenderList list)
Prepare for rendering, and potentially add itself to a list to be drawn
by a GLRenderer.
|
void |
removeInactiveContacts() |
void |
render(GLRenderer renderer,
int flags)
Render this object using Open GL via the JOGL.
|
void |
render(GLRenderer renderer,
RenderProps props,
int flags) |
void |
setAuxState(DataBuffer data)
Restores the state for this component by reading from the supplied
data buffer, starting at the current buffer offsets.
|
int |
setBilateralImpulses(VectorNd lam,
double h,
int idx) |
void |
setCompliance(double c) |
void |
setDamping(double d) |
void |
setDrawIntersectionContours(boolean set) |
void |
setDrawIntersectionFaces(boolean set) |
void |
setDrawIntersectionPoints(boolean set) |
void |
setFriction(double mu)
Sets the coeffcient of friction for this collision pair.
|
void |
setPenetrationTol(double tol) |
void |
setReduceConstraints(boolean set) |
void |
setRigidPointTolerance(double tol) |
void |
setRigidRegionTolerance(double tol) |
int |
setUnilateralImpulses(VectorNd the,
double h,
int idx) |
void |
skipAuxState(DataBuffer data)
Skips over the state information for this component contained
in the supplied data buffer, starting at the current buffer offsets.
|
void |
updateBounds(Point3d pmin,
Point3d pmax)
Update the minimum and maximum points for this object.
|
double |
updateConstraints(double t,
int flags) |
void |
zeroImpulses() |
advanceAuxState, hasState
copy, getRenderHints, getRenderProps, getSelection, isSelectable, numSelectionQueriesNeeded, setRenderProps, updateRenderProps
checkFlag, checkName, checkNameUniqueness, clearFlag, clone, connectToHierarchy, createTempFlag, disconnectFromHierarchy, getChildren, getGrandParent, getHardReferences, getName, getNameRange, getNavpanelVisibility, getNavpanelVisibility, getNumber, getParent, getProperty, getSoftReferences, hasChildren, isConnectedToHierarchy, isFixed, isMarked, isSelected, isWritable, makeValidName, makeValidName, notifyParentOfChange, postscan, printReferences, recursivelyContained, recursivelyContains, removeTempFlag, scan, setFixed, setFlag, setMarked, setName, setNavpanelVisibility, setNavpanelVisibility, setNumber, setParent, setSelected, updateReferences, write
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getRenderProps, setRenderProps
getRenderHints
connectToHierarchy, disconnectFromHierarchy, getHardReferences, getName, getNavpanelVisibility, getNumber, getParent, getSoftReferences, isFixed, isMarked, isSelected, notifyParentOfChange, postscan, scan, setFixed, setMarked, setName, setNumber, setParent, setSelected, updateReferences
getProperty
getChildren, hasChildren
isWritable, write
public static boolean useSignedDistanceCollider
public static boolean doBodyFaceContact
public static boolean computeTimings
public boolean reduceConstraints
public static PropertyList myProps
public CollisionHandler(CollisionManager manager)
public CollisionHandler(CollisionManager manager, CollidableBody col0, CollidableBody col1, CollisionBehavior behav)
public PropertyList getAllPropertyInfo()
HasProperties
getAllPropertyInfo
in interface HasProperties
getAllPropertyInfo
in class ModelComponentBase
public double getFriction()
public void setFriction(double mu)
public double getPenetrationTol()
public void setPenetrationTol(double tol)
public void setCompliance(double c)
public double getCompliance()
public void setDamping(double d)
public double getDamping()
public void setRigidPointTolerance(double tol)
public double getRigidPointTolerance()
public void setRigidRegionTolerance(double tol)
public double getRigidRegionTolerance()
public void setDrawIntersectionContours(boolean set)
public boolean isDrawIntersectionContours()
public void setDrawIntersectionFaces(boolean set)
public boolean isDrawIntersectionFaces()
public void setDrawIntersectionPoints(boolean set)
public boolean isDrawIntersectionPoints()
public boolean isReduceConstraints()
public void setReduceConstraints(boolean set)
public static boolean attachedNearContact(ContactPoint cpnt, Collidable collidable, java.util.Set<Vertex3d> attachedVertices)
public ContactConstraint getContact(java.util.HashMap<ContactPoint,ContactConstraint> contacts, ContactPoint cpnt0, ContactPoint cpnt1, boolean hashUsingFace, double distance)
public double computeCollisionConstraints(double t)
public void clearContactActivity()
public void removeInactiveContacts()
public void autoComputeCompliance(double acc, double tol)
acc
- accelerationtol
- desired penetration tolerancepublic double updateConstraints(double t, int flags)
updateConstraints
in interface Constrainer
updateConstraints
in class ConstrainerBase
public void getBilateralSizes(VectorNi sizes)
getBilateralSizes
in interface Constrainer
getBilateralSizes
in class ConstrainerBase
public void getUnilateralSizes(VectorNi sizes)
getUnilateralSizes
in interface Constrainer
getUnilateralSizes
in class ConstrainerBase
public void getBilateralConstraints(java.util.List<ContactConstraint> list)
public int addBilateralConstraints(SparseBlockMatrix GT, VectorNd dg, int numb)
addBilateralConstraints
in interface Constrainer
addBilateralConstraints
in class ConstrainerBase
public int getBilateralInfo(MechSystem.ConstraintInfo[] ginfo, int idx)
getBilateralInfo
in interface Constrainer
getBilateralInfo
in class ConstrainerBase
public int setBilateralImpulses(VectorNd lam, double h, int idx)
setBilateralImpulses
in interface Constrainer
setBilateralImpulses
in class ConstrainerBase
public int getBilateralImpulses(VectorNd lam, int idx)
getBilateralImpulses
in interface Constrainer
getBilateralImpulses
in class ConstrainerBase
public void zeroImpulses()
zeroImpulses
in interface Constrainer
zeroImpulses
in class ConstrainerBase
public int addUnilateralConstraints(SparseBlockMatrix NT, VectorNd dn, int numu)
addUnilateralConstraints
in interface Constrainer
addUnilateralConstraints
in class ConstrainerBase
public int getUnilateralInfo(MechSystem.ConstraintInfo[] ninfo, int idx)
getUnilateralInfo
in interface Constrainer
getUnilateralInfo
in class ConstrainerBase
public int setUnilateralImpulses(VectorNd the, double h, int idx)
setUnilateralImpulses
in interface Constrainer
setUnilateralImpulses
in class ConstrainerBase
public int getUnilateralImpulses(VectorNd the, int idx)
getUnilateralImpulses
in interface Constrainer
getUnilateralImpulses
in class ConstrainerBase
public int maxFrictionConstraintSets()
maxFrictionConstraintSets
in interface Constrainer
maxFrictionConstraintSets
in class ConstrainerBase
public int addFrictionConstraints(SparseBlockMatrix DT, MechSystem.FrictionInfo[] finfo, int numf)
addFrictionConstraints
in interface Constrainer
addFrictionConstraints
in class ConstrainerBase
public int numBilateralConstraints()
public int numUnilateralConstraints()
public void skipAuxState(DataBuffer data)
skipAuxState
in interface HasAuxState
skipAuxState
in class ConstrainerBase
data
- buffer containing the state informationpublic void getAuxState(DataBuffer data)
getAuxState
in interface HasAuxState
getAuxState
in class ConstrainerBase
data
- buffer for storing the state values.public void setAuxState(DataBuffer data)
setAuxState
in interface HasAuxState
setAuxState
in class ConstrainerBase
data
- buffer containing the state informationpublic void getInitialAuxState(DataBuffer newData, DataBuffer oldData)
If oldData
is non-null, then this contains
previously stored initial state information (starting at its current
buffer offsets), which should be stored into
newData
in place of the current component state data.
This may only be partially possible if the component's state structure
has changed since oldData
was written.
getInitialAuxState
in interface HasAuxState
getInitialAuxState
in class ConstrainerBase
newData
- buffer for storing the state values.oldData
- if non-null, contains old state information that should be
written into newData
in place of the current state
information.public void prerender(RenderList list)
GLRenderable
prerender
in interface GLRenderable
prerender
in class RenderableComponentBase
public RenderProps createRenderProps()
HasRenderProps
createRenderProps
in interface HasRenderProps
createRenderProps
in class RenderableComponentBase
public void render(GLRenderer renderer, int flags)
GLRenderable
render
in interface GLRenderable
render
in class RenderableComponentBase
renderer
- renderer object which is used to perform the rendering. Provides pointers
to GL and GLU, along with helper functions.flags
- supplies flags that may be used to control different
aspects of the rendering. Flags are defined in GLRenderer
and currently include
GLRenderer.SELECTED
,
GLRenderer.VERTEX_COLORING
,
GLRenderer.HSV_COLOR_INTERPOLATION
,
GLRenderer.SORT_FACES
, and
GLRenderer.CLEAR_MESH_DISPLAY_LISTS
.public void render(GLRenderer renderer, RenderProps props, int flags)
public void updateBounds(Point3d pmin, Point3d pmax)
GLRenderable
updateBounds
in interface GLRenderable
updateBounds
in class RenderableComponentBase
pmin
- minimum pointpmax
- maximum pointpublic java.util.Map<Vertex3d,Vector3d> getContactImpulses(CollidableBody colA)
public ContactInfo getRenderContactInfo()