public class CollisionHandler extends ConstrainerBase implements HasRenderProps, Renderable
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
TRANSPARENT, 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) |
Collidable |
getCollidable(int idx) |
double |
getCompliance() |
void |
getConstrainedComponents(java.util.HashSet<DynamicComponent> set) |
void |
getConstrainedComponents(java.util.List<DynamicComponent> list) |
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() |
ContactForceBehavior |
getForceBehavior() |
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.
|
ContactInfo |
getLastContactInfo() |
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 |
isCompliant() |
boolean |
isDrawIntersectionContours() |
boolean |
isDrawIntersectionFaces() |
boolean |
isDrawIntersectionPoints() |
boolean |
isReduceConstraints() |
int |
maxFrictionConstraintSets() |
int |
numBilateralConstraints() |
int |
numUnilateralConstraints() |
void |
prerender(RenderList list)
Called prior to rendering to allow this object to update the internal
state required for rendering (such as by caching rendering coordinates).
|
void |
prerender(RenderProps props) |
void |
removeInactiveContacts() |
void |
render(Renderer renderer,
int flags)
Render this object using the functionality of the supplied
Renderer . |
void |
render(Renderer 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 |
setForceBehavior(ContactForceBehavior behavior) |
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(Vector3d pmin,
Vector3d 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
getSelection, isSelectable, numSelectionQueriesNeeded
getRenderHints
getRenderProps, setRenderProps
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 ContactInfo getLastContactInfo()
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 boolean isCompliant()
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 void setForceBehavior(ContactForceBehavior behavior)
public ContactForceBehavior getForceBehavior()
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 Collidable getCollidable(int idx)
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 getConstrainedComponents(java.util.List<DynamicComponent> list)
getConstrainedComponents
in interface Constrainer
getConstrainedComponents
in class ConstrainerBase
public void getConstrainedComponents(java.util.HashSet<DynamicComponent> set)
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(RenderProps props)
public void prerender(RenderList list)
IsRenderable
list.addIfVisible (obj);
for each of the objects in question.prerender
in interface IsRenderable
prerender
in class RenderableComponentBase
list
- list of objects to be renderedpublic RenderProps createRenderProps()
HasRenderProps
createRenderProps
in interface HasRenderProps
createRenderProps
in class RenderableComponentBase
public void render(Renderer renderer, int flags)
IsRenderable
Renderer
.render
in interface IsRenderable
render
in class RenderableComponentBase
renderer
- provides the functionality used to perform the rendering.flags
- flags that may be used to control different
aspects of the rendering. Flags are defined in Renderer
and currently include
Renderer.HIGHLIGHT
and
Renderer.SORT_FACES
.public void render(Renderer renderer, RenderProps props, int flags)
public void updateBounds(Vector3d pmin, Vector3d pmax)
IsRenderable
updateBounds
in interface IsRenderable
updateBounds
in class RenderableComponentBase
pmin
- minimum pointpmax
- maximum pointpublic java.util.Map<Vertex3d,Vector3d> getContactImpulses(CollidableBody colA)
public ContactInfo getRenderContactInfo()