public class CollisionHandler extends ConstrainerBase implements HasRenderProps, Renderable
ModelComponent.NavpanelVisibility
Modifier and Type | Field and Description |
---|---|
static boolean |
computeTimings |
static PropertyList |
myProps |
static boolean |
useOneBilateralSet |
enforceUniqueCompositeNames, enforceUniqueNames, myNumber, NULL_OBJ, useCompactPathNames
TRANSPARENT, TWO_DIMENSIONAL
Constructor and Description |
---|
CollisionHandler(CollisionManager manager) |
CollisionHandler(CollisionManager manager,
CollidableBody col0,
CollidableBody col1,
CollisionBehavior behav,
artisynth.core.mechmodels.CollisionManager.BehaviorSource src) |
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 |
clearContactActivity() |
double |
computeCollisionConstraints(ContactInfo cinfo) |
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 |
getBilateralConstraints(java.util.List<ContactConstraint> list) |
int |
getBilateralForces(VectorNd lam,
int idx) |
int |
getBilateralInfo(MechSystem.ConstraintInfo[] ginfo,
int idx) |
void |
getBilateralSizes(VectorNi sizes) |
int |
getBodyIndex(Collidable col)
Returns 0 if a specified collidable is associated with this handler's
first collidable body, 1 if it is associated with the second body,
and -1 if it is associated with neither.
|
CollidableBody |
getCollidable(int cidx) |
CollidablePair |
getCollidablePair() |
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) |
CollisionHandler |
getDown()
Returns next handler in a column of a CollisionHandlerTable.
|
ContactInfo |
getLastContactInfo() |
CollisionHandler |
getNext()
Returns next handler in a row of a CollisionHandlerTable.
|
CollidableBody |
getOtherCollidable(CollidableBody cb) |
ContactInfo |
getRenderContactInfo()
Get most recent ContactInfo info, for rendering purposes.
|
RenderProps |
getRenderProps()
Returns the render properities for this object.
|
void |
getState(DataBuffer data)
Saves state information for this component by adding data to the
supplied DataBuffer.
|
int |
getUnilateralForces(VectorNd the,
int idx) |
int |
getUnilateralInfo(MechSystem.ConstraintInfo[] ninfo,
int idx) |
void |
getUnilateralSizes(VectorNi sizes) |
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) |
int |
setBilateralForces(VectorNd lam,
double s,
int idx) |
void |
setDown(CollisionHandler down)
Sets next handler in a column of a CollisionHandlerTable.
|
void |
setNext(CollisionHandler next)
Sets next handler in a row of a CollisionHandlerTable.
|
void |
setState(DataBuffer data)
Restores the state for this component by reading from the supplied
data buffer, starting at the current buffer offsets.
|
int |
setUnilateralForces(VectorNd the,
double s,
int idx) |
void |
updateBounds(Vector3d pmin,
Vector3d pmax)
Update the minimum and maximum points for this object.
|
double |
updateConstraints(double t,
int flags)
Updates the current set of constraints, and returns the maximum
penetration
> 0 associated with all of them. |
void |
zeroForces() |
advanceState, hasState
copy, getRenderHints, getSelection, isSelectable, isVisible, numSelectionQueriesNeeded, setRenderProps, setVisible, updateRenderProps
checkFlag, checkName, checkNameUniqueness, clearFlag, clone, connectToHierarchy, createTempFlag, disconnectFromHierarchy, getChildren, getGrandParent, getHardReferences, getName, getNameRange, getNavpanelVisibility, getNavpanelVisibility, getNumber, getParent, getProperty, getSoftReferences, hasChildren, isFixed, isMarked, isScanning, isSelected, isWritable, makeValidName, makeValidName, notifyParentOfChange, postscan, printReferences, recursivelyContained, recursivelyContains, removeTempFlag, scan, setFixed, setFlag, setMarked, setName, setNavpanelVisibility, setNavpanelVisibility, setNumber, setParent, setScanning, setSelected, setWritable, updateReferences, write
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getSelection, isSelectable, numSelectionQueriesNeeded
getRenderHints
setRenderProps
getStateVersion
connectToHierarchy, disconnectFromHierarchy, getHardReferences, getName, getNavpanelVisibility, getNumber, getParent, getSoftReferences, isFixed, isMarked, isSelected, notifyParentOfChange, scan, setFixed, setMarked, setName, setNumber, setParent, setSelected, setWritable, updateReferences
getProperty
getChildren, hasChildren
postscan
isWritable, write
public static boolean computeTimings
public static boolean useOneBilateralSet
public static PropertyList myProps
public CollisionHandler(CollisionManager manager)
public CollisionHandler(CollisionManager manager, CollidableBody col0, CollidableBody col1, CollisionBehavior behav, artisynth.core.mechmodels.CollisionManager.BehaviorSource src)
public PropertyList getAllPropertyInfo()
HasProperties
getAllPropertyInfo
in interface HasProperties
getAllPropertyInfo
in class ModelComponentBase
public RenderProps getRenderProps()
HasRenderProps
getRenderProps
in interface HasRenderProps
getRenderProps
in class RenderableComponentBase
public ContactInfo getLastContactInfo()
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(ContactInfo cinfo)
public CollidableBody getCollidable(int cidx)
public int getBodyIndex(Collidable col)
col
- collidable to inspectcol
.public CollidableBody getOtherCollidable(CollidableBody cb)
public CollidablePair getCollidablePair()
public CollisionHandler getNext()
public void setNext(CollisionHandler next)
next
- next handler to add to the rowpublic CollisionHandler getDown()
public void setDown(CollisionHandler down)
down
- next handler to add to the columnpublic void clearContactActivity()
public void removeInactiveContacts()
public double updateConstraints(double t, int flags)
Constrainer
>
0 associated with all of them. If no constraints are
presently active, returns -1.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 setBilateralForces(VectorNd lam, double s, int idx)
setBilateralForces
in interface Constrainer
setBilateralForces
in class ConstrainerBase
public int getBilateralForces(VectorNd lam, int idx)
getBilateralForces
in interface Constrainer
getBilateralForces
in class ConstrainerBase
public void zeroForces()
zeroForces
in interface Constrainer
zeroForces
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 setUnilateralForces(VectorNd the, double s, int idx)
setUnilateralForces
in interface Constrainer
setUnilateralForces
in class ConstrainerBase
public int getUnilateralForces(VectorNd the, int idx)
getUnilateralForces
in interface Constrainer
getUnilateralForces
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 getState(DataBuffer data)
getState
in interface HasNumericState
getState
in class ConstrainerBase
data
- buffer for storing the state values.public void setState(DataBuffer data)
setState
in interface HasNumericState
setState
in class ConstrainerBase
data
- buffer containing the state informationpublic 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 ContactInfo getRenderContactInfo()